protected function filterList(array &$list, array $allowed_fields, array $query)
    {
        $filter = array_intersect_key($query, array_flip($allowed_fields));

        if (!empty($filter)) {
            $list = array_filter($list, function ($item) use ($filter) {
                return $this->callbackFilterList($item, $filter);
            });
        }
    }
protected function filterList(array &$list, array $allowed_fields, array $query)
    {
        $filter = array_intersect_key($query, array_flip($allowed_fields));

        if (!empty($filter)) {
            $list = array_filter($list, function ($item) use ($filter) {
                return $this->callbackFilterList($item, $filter);
            });
        }
    }
protected function filterList ( array & $ list , array $ allowed_fields , array $ query ) { $ filter = array_intersect_key ( $ query , array_flip ( $ allowed_fields ) ) ; if ( ! empty ( $ filter ) ) { $ list = array_filter ( $ list , function ( $ item ) use ( $ filter ) { return $ this -> callbackFilterList ( $ item , $ filter ) ; } ) ; } }
Filter the list by a field
@param array $list
@param array $allowed_fields
@param array $query
Filter the list by a field