lithium\util\Collection::reduce()
Reduce, or fold, a collection down to a single value
Parameters
-
callback
$reducerThe reduce function, i.e.
function($carry, $item) { return ... } -
mixed
$initialInitial value passed to the reduce function as
$carry, defaults tofalse.
Returns
mixedA single reduced value.
Links
Source
public function reduce($reducer, $initial = false) {
return array_reduce($this->_data, $reducer, $initial);
}