Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (&$theArray, $page=-1, $itemsPerPage=-1) | |
array_slice_key ($array, $offset, $len=-1) | |
atFirstPage () | |
atLastPage () | |
eof () | |
& | fromRangeInfo (&$theArray, &$theRange) |
getCount () | |
getPage () | |
getPageCount () | |
& | next () |
nextWithKey () | |
& | toArray () |
& | toAssociativeArray () |
wasEmpty () | |
Public Member Functions inherited from ItemIterator | |
__construct () | |
Data Fields | |
$count | |
$itemsPerPage | |
$page | |
$theArray | |
$wasEmpty | |
Provides paging and iteration for arrays.
Definition at line 19 of file ArrayItemIterator.inc.php.
ArrayItemIterator::__construct | ( | & | $theArray, |
$page = -1 , |
|||
$itemsPerPage = -1 |
|||
) |
Constructor.
$theArray | array The array of items to iterate through |
$page | int the current page number |
$itemsPerPage | int Number of items to display per page |
Definition at line 53 of file ArrayItemIterator.inc.php.
References $itemsPerPage, $page, $theArray, array_slice_key(), and wasEmpty().
ArrayItemIterator::array_slice_key | ( | $array, | |
$offset, | |||
$len = -1 |
|||
) |
A version of array_slice that takes keys into account. Thanks to pies at sputnik dot pl. This is made redundant by PHP 5.0.2's updated array_slice, but we can't assume everyone has that. FIXME: Reconcile this against the dupe in VirtualArrayIterator.
Definition at line 188 of file ArrayItemIterator.inc.php.
Referenced by __construct().
ArrayItemIterator::atFirstPage | ( | ) |
Determine whether or not this iterator represents the first page
Reimplemented from ItemIterator.
Definition at line 113 of file ArrayItemIterator.inc.php.
ArrayItemIterator::atLastPage | ( | ) |
Determine whether or not this iterator represents the last page
Reimplemented from ItemIterator.
Definition at line 121 of file ArrayItemIterator.inc.php.
References $count.
ArrayItemIterator::eof | ( | ) |
Return a boolean indicating whether or not we've reached the end of results
Reimplemented from ItemIterator.
Definition at line 153 of file ArrayItemIterator.inc.php.
& ArrayItemIterator::fromRangeInfo | ( | & | $theArray, |
& | $theRange | ||
) |
Static method: Generate an iterator from an array and rangeInfo object.
$theArray | array |
$theRange | object |
Definition at line 74 of file ArrayItemIterator.inc.php.
References $theArray.
ArrayItemIterator::getCount | ( | ) |
Get the total count of items
Reimplemented from ItemIterator.
Definition at line 137 of file ArrayItemIterator.inc.php.
References $count.
ArrayItemIterator::getPage | ( | ) |
Get the current page number
Reimplemented from ItemIterator.
Definition at line 129 of file ArrayItemIterator.inc.php.
References $page.
ArrayItemIterator::getPageCount | ( | ) |
Get the number of pages
Reimplemented from ItemIterator.
Definition at line 145 of file ArrayItemIterator.inc.php.
& ArrayItemIterator::next | ( | ) |
Return the next item in the iterator.
Reimplemented from ItemIterator.
Definition at line 87 of file ArrayItemIterator.inc.php.
Referenced by nextWithKey().
ArrayItemIterator::nextWithKey | ( | ) |
Return the next item in the iterator, with key.
Reimplemented from ItemIterator.
Definition at line 103 of file ArrayItemIterator.inc.php.
References next().
& ArrayItemIterator::toArray | ( | ) |
Convert this iterator to an array
Reimplemented from ItemIterator.
Definition at line 169 of file ArrayItemIterator.inc.php.
References $theArray.
& ArrayItemIterator::toAssociativeArray | ( | ) |
Return this iterator as an associative array.
Definition at line 176 of file ArrayItemIterator.inc.php.
References $theArray.
ArrayItemIterator::wasEmpty | ( | ) |
Return a boolean indicating whether or not this iterator was empty from the beginning
Reimplemented from ItemIterator.
Definition at line 161 of file ArrayItemIterator.inc.php.
References $wasEmpty.
Referenced by __construct().
int ArrayItemIterator::$count |
The total number of items.
Definition at line 42 of file ArrayItemIterator.inc.php.
Referenced by atLastPage(), and getCount().
int ArrayItemIterator::$itemsPerPage |
Number of items to iterate through on this page
Definition at line 30 of file ArrayItemIterator.inc.php.
Referenced by __construct().
int ArrayItemIterator::$page |
The current page.
Definition at line 36 of file ArrayItemIterator.inc.php.
Referenced by __construct(), and getPage().
array ArrayItemIterator::$theArray |
The array of contents of this iterator.
Definition at line 24 of file ArrayItemIterator.inc.php.
Referenced by __construct(), fromRangeInfo(), toArray(), and toAssociativeArray().
ArrayItemIterator::$wasEmpty |
Whether or not the iterator was empty from the start
Definition at line 45 of file ArrayItemIterator.inc.php.
Referenced by wasEmpty().