diff -r fc78844c8a76 -r 99ad73ef7385 vendor/bundles/Pagerfanta/Adapter/ArrayAdapter.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/bundles/Pagerfanta/Adapter/ArrayAdapter.php Fri Oct 21 17:10:54 2011 +0200 @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Pagerfanta\Adapter; + +/** + * ArrayAdapter. + * + * @author Pablo Díez + * + * @api + */ +class ArrayAdapter implements AdapterInterface +{ + private $array; + + /** + * Constructor. + * + * @param array $array The array. + * + * @api + */ + public function __construct(array $array) + { + $this->array = $array; + } + + /** + * Returns the array. + * + * @return array The array. + * + * @api + */ + public function getArray() + { + return $this->array; + } + + /** + * {@inheritdoc} + */ + public function getNbResults() + { + return count($this->array); + } + + /** + * {@inheritdoc} + */ + public function getSlice($offset, $length) + { + return array_slice($this->array, $offset, $length); + } +}