Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Paginator / Adapter / Null.php
blobe7e075ed0537555ac5526950d8d8d4a6a588f183
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Paginator\Adapter;
12 class Null implements AdapterInterface
14 /**
15 * Item count
17 * @var int
19 protected $count = null;
21 /**
22 * Constructor.
24 * @param int $count Total item count (Optional)
26 public function __construct($count = 0)
28 $this->count = $count;
31 /**
32 * Returns an array of items for a page.
34 * @param int $offset Page offset
35 * @param int $itemCountPerPage Number of items per page
36 * @return array
38 public function getItems($offset, $itemCountPerPage)
40 if ($offset >= $this->count()) {
41 return array();
44 $remainItemCount = $this->count() - $offset;
45 $currentItemCount = $remainItemCount > $itemCountPerPage ? $itemCountPerPage : $remainItemCount;
47 return array_fill(0, $currentItemCount, null);
50 /**
51 * Returns the total number of rows in the array.
53 * @return int
55 public function count()
57 return $this->count;