| @@ 41-48 (lines=8) @@ | ||
| 38 | * |
|
| 39 | * @param array $pager |
|
| 40 | */ |
|
| 41 | public function __construct($pager) |
|
| 42 | { |
|
| 43 | $this->_pager = $pager; |
|
| 44 | $this->_pageSize = 0; |
|
| 45 | $this->_currentPage = 0; |
|
| 46 | $this->_totalItems = 0; |
|
| 47 | $this->_index = 0; |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * returns the current item when iterating with foreach |
|
| @@ 74-81 (lines=8) @@ | ||
| 71 | /** |
|
| 72 | * rewinds the collection to the first item when iterating with foreach |
|
| 73 | */ |
|
| 74 | public function rewind() |
|
| 75 | { |
|
| 76 | $this->_index = 0; |
|
| 77 | $this->_currentPage = 0; |
|
| 78 | $this->_pageSize = 0; |
|
| 79 | $this->_totalItems = 0; |
|
| 80 | $this->_items = []; |
|
| 81 | } |
|
| 82 | ||
| 83 | /** |
|
| 84 | * returns whether the current item is valid when iterating with foreach |
|