public function search(array $filters)
    {
        return $this->filter(function (CollectionableInterface $entity) use ($filters) {
            $res = true;
            foreach ($filters as $key => $value) {
                $current = $this->getPropertyAccessor()->getValue($entity, $key);
                $res = $res && (is_array($value) ?
                    in_array($current, $value) :
                    $current == $value
                );
            }

            return $res;
        });
    }
public function search(array $filters)
    {
        return $this->filter(function (CollectionableInterface $entity) use ($filters) {
            $res = true;
            foreach ($filters as $key => $value) {
                $current = $this->getPropertyAccessor()->getValue($entity, $key);
                $res = $res && (is_array($value) ?
                    in_array($current, $value) :
                    $current == $value
                );
            }

            return $res;
        });
    }
public function search ( array $ filters ) { return $ this -> filter ( function ( CollectionableInterface $ entity ) use ( $ filters ) { $ res = true ; foreach ( $ filters as $ key => $ value ) { $ current = $ this -> getPropertyAccessor ( ) -> getValue ( $ entity , $ key ) ; $ res = $ res && ( is_array ( $ value ) ? in_array ( $ current , $ value ) : $ current == $ value ) ; } return $ res ; } ) ; }
filter given collection on given fields.

@param array $filters

@return EntityCollection
filter given collection on given fields .