public function ArrayCollection::slice in Plug 7
Extracts a slice of $length elements starting at position $offset from the Collection.
If $length is null it returns all elements from $offset to the end of the Collection. Keys have to be preserved by this method. Calling this method will only return the selected slice and NOT change the elements contained in the collection slice is called on.
Parameters
int $offset The offset to start from.:
int|null $length The maximum number of elements to return, or null for no limit.:
Return value
array
Overrides Collection::slice
File
- lib/
doctrine/ collections/ lib/ Doctrine/ Common/ Collections/ ArrayCollection.php, line 351
Class
- ArrayCollection
- An ArrayCollection is a Collection implementation that wraps a regular PHP array.
Namespace
Doctrine\Common\CollectionsCode
public function slice($offset, $length = null) {
return array_slice($this->elements, $offset, $length, true);
}