- \Somnambulist\Components\Collection\Behaviours\Partition\Splice
- \Somnambulist\Components\Collection\Behaviours\Partition\Partition
- \Somnambulist\Components\Collection\Behaviours\Partition\Slice
- \Somnambulist\Components\Collection\Behaviours\Partition\GroupBy
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 |
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 |
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. |
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. |