function Collection::slice

Extract 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:

int $length:

Return value

array

1 method overrides Collection::slice()
ArrayCollection::slice in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php
Extract a slice of $length elements starting at position $offset from the Collection.

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php, line 242

Class

Collection
The missing (SPL) Collection/Array/OrderedMap interface.

Namespace

Doctrine\Common\Collections

Code

function slice($offset, $length = null);