public
__construct ( [ array|iterable|callback $dataSource ] )
Constructs a new data list.
public self
concat ( array|iterable $list )
Appends the items of the list provided to the current list.
public int
count ( void )
Returns the number of items in the list.
public self
filter ( callable $callback )
Filters the elements of the list using a callback function.
public self
filterBy ( string $property , mixed $value [, string $operator = 'equal' ] )
Filters the elements of the list by specific property value.
public object|null
get ( int $index )
Returns the object at the index specified or null if not found.
public object|null
getFirst ( void )
Returns the first object or null if not found.
public object|null
getLast ( void )
Returns the last object or null if not found.
public object|null
getRandom ( void )
Returns a random object from the list or null if the list is empty.
public self
map ( callable $callback )
Applies the callback to the objects of the list.
public object|null
pop ( void )
Pops an object off the end of the list.
public self
push ( object|array $object )
Pushes an object onto the end of the list.
public self
reverse ( void )
Reverses the order of the objects in the list.
public object|null
shift ( void )
Shift an object off the beginning of the list.
public self
shuffle ( void )
Randomly reorders the objects in the list.
public mixed
slice ( int $offset [, int $length ] )
Extract a slice of the list.
public mixed
sliceProperties ( array $properties )
Returns a new list of object that contain only the specified properties of the objects in the current list.
public self
sort ( callable $callback )
Sorts the elements of the list using a callback function.
public self
sortBy ( string $property [, string $order = 'asc' ] )
Sorts the elements of the list by specific property.
public array
toArray ( void )
Returns the list data converted as an array.
public string
toJSON ( void )
Returns the list data converted as JSON.
public self
unshift ( object|array $object )
Prepends an object to the beginning of the list.