Skip to content

Latest commit

 

History

History
47 lines (29 loc) · 2.59 KB

partitionable.md

File metadata and controls

47 lines (29 loc) · 2.59 KB

Table of contents


Class: \Somnambulist\Components\Collection\Behaviours\Partition\Splice

Trait Splice

Visibility Function
public splice(\int $offset, \int $length=null, array/mixed $replacement=array()) : \Somnambulist\Components\Collection\Collection/static
Splice a portion of the underlying collection

Class: \Somnambulist\Components\Collection\Behaviours\Partition\Partition

Trait Partition

Visibility Function
public partition(callable/string/\string $callback) : \Somnambulist\Components\Collection\Behaviours\Partition\Collection/static[static, static]
Partition the Collection into two Collections using the given callback or key. Based on Laravel: Illuminate\Support\Collection.partition

Class: \Somnambulist\Components\Collection\Behaviours\Partition\Slice

Trait Slice

Visibility Function
public slice(\int $offset, \int $limit=null, \bool $keys=true) : \Somnambulist\Components\Collection\Collection/static
Extracts a portion of the Collection, returning a new Collection By default, preserves the keys.

Class: \Somnambulist\Components\Collection\Behaviours\Partition\GroupBy

Trait GroupBy

Visibility Function
public groupBy(\callable $criteria) : \Somnambulist\Components\Collection\Collection/static
Group the elements in the collection by the callable, returning a new collection The callable should return a valid key to group elements into. A valid key is a string or integer or the current rules of PHP. Each group is a collection of the values matched to it.