Пример #1
0
 /**
  * Retrieve searchable attributes
  *
  * @deprecated since version 1.13.2
  * @param string $backendType
  * @return array
  */
 protected function _getSearchableAttributes($backendType = null)
 {
     if (is_null($this->_searchableAttributes)) {
         $this->_searchableAttributes = array();
         /** @var $productAttributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */
         $productAttributeCollection = $this->_factory->getResourceModel('catalog/product_attribute_collection');
         $productAttributeCollection->addSearchableAttributeFilter();
         $attributes = $productAttributeCollection->getItems();
         /** @var $entity Mage_Catalog_Model_Resource_Product */
         $entity = $this->_getEavConfig()->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getEntity();
         foreach ($attributes as $attribute) {
             /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
             $attribute->setEntity($entity);
         }
         $this->_searchableAttributes = $attributes;
     }
     if (!is_null($backendType)) {
         $attributes = array();
         foreach ($this->_searchableAttributes as $attributeId => $attribute) {
             /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
             if ($attribute->getBackendType() == $backendType) {
                 $attributes[$attributeId] = $attribute;
             }
         }
         return $attributes;
     }
     return $this->_searchableAttributes;
 }