$data
$data : array
Array data
Record collection class
each(callable $callback) : \Pop\Utils\Collection
Execute a callback over each item
callable | $callback |
every(integer $step, integer $offset) : \Pop\Utils\Collection
Create a new collection from every n-th element
integer | $step | |
integer | $offset |
filter(callable $callback = null, integer $flag) : \Pop\Utils\Collection
Apply filter to the collection
callable | $callback | |
integer | $flag |
map(callable $callback, integer $flag) : \Pop\Utils\Collection
Apply map to the collection
callable | $callback | |
integer | $flag |
flip() : \Pop\Utils\Collection
Flip the data in the collection
keys() : \Pop\Utils\Collection
Get the keys of the collection data
values() : \Pop\Utils\Collection
Get the values of the collection data
merge(mixed $data, boolean $recursive = false) : \Pop\Utils\Collection
Merge the collection with the passed data
mixed | $data | |
boolean | $recursive |
forPage(integer $page, integer $perPage) : \Pop\Utils\Collection
Slice the collection for a page
integer | $page | |
integer | $perPage |
push(mixed $value) : \Pop\Utils\Collection
Push an item onto the end of the collection.
mixed | $value |
slice(integer $offset, integer $length = null) : \Pop\Utils\Collection
Slice the collection
integer | $offset | |
integer | $length |
splice(integer $offset, integer|null $length = null, mixed $replacement = array()) : \Pop\Utils\Collection
Splice a portion of the collection
integer | $offset | |
integer|null | $length | |
mixed | $replacement |
sort(callable|null $callback = null, integer $flags = SORT_REGULAR) : \Pop\Utils\Collection
Sort data
callable|null | $callback | |
integer | $flags |
sortByAsc(integer $flags = SORT_REGULAR) : \Pop\Utils\Collection
Sort the collection ascending
integer | $flags |
sortByDesc(integer $flags = SORT_REGULAR) : \Pop\Utils\Collection
Sort the collection descending
integer | $flags |