当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Eav_Model_Entity_Attribute::getCollection方法代码示例

本文整理汇总了PHP中Mage_Eav_Model_Entity_Attribute::getCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Attribute::getCollection方法的具体用法?PHP Mage_Eav_Model_Entity_Attribute::getCollection怎么用?PHP Mage_Eav_Model_Entity_Attribute::getCollection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Eav_Model_Entity_Attribute的用法示例。


在下文中一共展示了Mage_Eav_Model_Entity_Attribute::getCollection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCollection

 /**
  * Retrive Vendor attribute collection
  *
  * @return Mage_Eav_Model_Resource_Entity_Collection
  */
 public function getCollection()
 {
     $collection = parent::getCollection();
     $typeId = Mage::getModel('csmarketplace/vendor')->getEntityTypeId();
     $collection = $collection->addFieldToFilter('entity_type_id', array('eq' => $typeId));
     $labelTableName = Mage::getSingleton('core/resource')->getTableName('eav/attribute_label');
     $tableName = Mage::getSingleton('core/resource')->getTableName('csmarketplace/vendor_form');
     if ($this->getStoreId()) {
         $availableStoreWiseIds = $this->getStoreWiseIds($this->getStoreId());
         $collection->getSelect()->join(array('vform' => $tableName), 'main_table.attribute_id=vform.attribute_id', array('is_visible' => 'vform.is_visible', 'sort_order' => 'vform.sort_order', 'store_id' => 'vform.store_id', 'use_in_registration' => 'vform.use_in_registration', 'use_in_left_profile' => 'vform.use_in_left_profile', 'position_in_registration' => 'vform.position_in_registration', 'position_in_left_profile' => 'vform.position_in_left_profile', 'fontawesome_class_for_left_profile' => 'vform.fontawesome_class_for_left_profile'));
         $collection->getSelect()->where('(vform.attribute_id IN ("' . $availableStoreWiseIds . '") AND vform.store_id=' . $this->getStoreId() . ') OR (vform.attribute_id NOT IN ("' . $availableStoreWiseIds . '") AND vform.store_id=0)');
         $collection->getSelect()->group('vform.attribute_id');
         $collection->getSelect()->joinLeft(array('vlabel' => $labelTableName), 'main_table.attribute_id=vlabel.attribute_id && vlabel.store_id=' . $this->getStoreId(), array('store_label' => 'vlabel.value'));
     } else {
         $collection->getSelect()->join(array('vform' => $tableName), 'main_table.attribute_id=vform.attribute_id && vform.store_id=0', array('is_visible' => 'vform.is_visible', 'sort_order' => 'vform.sort_order', 'store_id' => 'vform.store_id', 'use_in_registration' => 'vform.use_in_registration', 'use_in_left_profile' => 'vform.use_in_left_profile', 'position_in_registration' => 'vform.position_in_registration', 'position_in_left_profile' => 'vform.position_in_left_profile', 'fontawesome_class_for_left_profile' => 'vform.fontawesome_class_for_left_profile'));
         $collection->getSelect()->joinLeft(array('vlabel' => $labelTableName), 'main_table.attribute_id=vlabel.attribute_id && vlabel.store_id=0', array('store_label' => 'vlabel.value'));
     }
     /* $collection->addExpressionFieldToSelect("is_visible","(CASE WHEN `"."vform"."`.`is_visible` IS NULL THEN (SELECT `".$tableName."`.`is_visible` from `".$tableName."` WHERE `".$tableName."`.`store_id`=0 AND `".$tableName."`.`attribute_id`=`vform`.`attribute_id`) ELSE `"."vform"."`.`is_visible` END)", "");
     		echo $collection->getSelect();die; */
     return $collection;
 }
开发者ID:sixg,项目名称:mkAnagh,代码行数:26,代码来源:Attribute.php


注:本文中的Mage_Eav_Model_Entity_Attribute::getCollection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。