本文整理匯總了PHP中Doctrine\Common\Collections\ArrayCollection::slice方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArrayCollection::slice方法的具體用法?PHP ArrayCollection::slice怎麽用?PHP ArrayCollection::slice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\Common\Collections\ArrayCollection
的用法示例。
在下文中一共展示了ArrayCollection::slice方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: slice
/** {@inheritDoc} */
public function slice($offset, $length = null)
{
$this->initialize();
return $this->collection->slice($offset, $length);
}
示例2: slice
function slice($offset, $length = null)
{
return $this->fields->slice($offset, $length);
}
示例3: slice
/**
* 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.
*
* @param int $offset The offset to start from.
* @param int|null $length The maximum number of elements to return, or null for no limit.
*
* @return array
*/
public function slice($offset, $length = null)
{
return $this->collection->slice($offset, $length);
}
示例4: getItems
/**
* Returns an collection of items for a page.
*
* @param int $offset Page offset
* @param int $itemCountPerPage Number of items per page
* @return array
*/
public function getItems($offset, $itemCountPerPage)
{
return $this->collection->slice($offset, $itemCountPerPage);
}