public function addFieldsToFilter($fields)
    {
        if ($fields) {
            foreach ($fields as $fieldByType) {
                foreach ($fieldByType as $attributeId => $condition) {
                    $attributeCode = $this->getEntity()->getAttribute($attributeId)->getAttributeCode();
                    $condition     = $this->cleanCondition($condition);

                    if (null !== $condition) {
                        $this->addFieldToFilter($attributeCode, $condition);
                    }
                }
            }
        }

        return $this;
    }
public function addFieldsToFilter($fields)
    {
        if ($fields) {
            foreach ($fields as $fieldByType) {
                foreach ($fieldByType as $attributeId => $condition) {
                    $attributeCode = $this->getEntity()->getAttribute($attributeId)->getAttributeCode();
                    $condition     = $this->cleanCondition($condition);

                    if (null !== $condition) {
                        $this->addFieldToFilter($attributeCode, $condition);
                    }
                }
            }
        }

        return $this;
    }
public function addFieldsToFilter ( $ fields ) { if ( $ fields ) { foreach ( $ fields as $ fieldByType ) { foreach ( $ fieldByType as $ attributeId => $ condition ) { $ attributeCode = $ this -> getEntity ( ) -> getAttribute ( $ attributeId ) -> getAttributeCode ( ) ; $ condition = $ this -> cleanCondition ( $ condition ) ; if ( null !== $ condition ) { $ this -> addFieldToFilter ( $ attributeCode , $ condition ) ; } } } } return $ this ; }
Add multiple fields to filter

@param array $fields The fields to filter

@return $this
Add multiple fields to filter