本文整理汇总了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);
}