public function filter(Query $query)
    {
        if (!empty($this->filterOptions['conditions'])) {
            $query->where($this->filterOptions['conditions']);
        }
        if (!empty($this->filterOptions['order'])) {
            $query->order($this->filterOptions['order']);
        }

        return $query;
    }
public function filter(Query $query)
    {
        if (!empty($this->filterOptions['conditions'])) {
            $query->where($this->filterOptions['conditions']);
        }
        if (!empty($this->filterOptions['order'])) {
            $query->order($this->filterOptions['order']);
        }

        return $query;
    }
public function filter ( Query $ query ) { if ( ! empty ( $ this -> filterOptions [ 'conditions' ] ) ) { $ query -> where ( $ this -> filterOptions [ 'conditions' ] ) ; } if ( ! empty ( $ this -> filterOptions [ 'order' ] ) ) { $ query -> order ( $ this -> filterOptions [ 'order' ] ) ; } return $ query ; }
Apply filter conditions and order options to the given query.

@param Query $query
@return Query
Apply filter conditions and order options to the given query .