public function filter(array $objects, $expression)
    {
        $filteredObjects = [];

        foreach ($objects as $key => $object) {
            try {
                if (@$this->language->evaluate('object.'.$expression, ['object' => $object])) {
                    $filteredObjects[] = $object;
                }
            } catch (\Exception $exception) {
                // Property does not exist: ignore this item
            }
        }

        return $filteredObjects;
    }
public function filter(array $objects, $expression)
    {
        $filteredObjects = [];

        foreach ($objects as $key => $object) {
            try {
                if (@$this->language->evaluate('object.'.$expression, ['object' => $object])) {
                    $filteredObjects[] = $object;
                }
            } catch (\Exception $exception) {
                // Property does not exist: ignore this item
            }
        }

        return $filteredObjects;
    }
public function filter ( array $ objects , $ expression ) { $ filteredObjects = [ ] ; foreach ( $ objects as $ key => $ object ) { try { if ( @ $ this -> language -> evaluate ( 'object.' . $ expression , [ 'object' => $ object ] ) ) { $ filteredObjects [ ] = $ object ; } } catch ( \ Exception $ exception ) { // Property does not exist: ignore this item } } return $ filteredObjects ; }
Returns the objects filtered by the given path value.

@param array  $objects
@param string $expression

@return array
Returns the objects filtered by the given path value .