lithium\data\Collection::_filterFromArray PHP Метод

_filterFromArray() защищенный Метод

Creates a filter based on an array of key/value pairs that must match the items in a Collection.
protected _filterFromArray ( array $filter ) : Closure
$filter array An array of key/value pairs used to filter `Collection` items.
Результат Closure Returns a closure that wraps the array and attempts to match each value against `Collection` item properties.
    protected function _filterFromArray(array $filter)
    {
        return function ($item) use($filter) {
            foreach ($filter as $key => $val) {
                if ($item->{$key} != $val) {
                    return false;
                }
            }
            return true;
        };
    }