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


PHP Mage_Eav_Model_Entity_Collection_Abstract::_getLoadAttributesSelect方法代码示例

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


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

示例1: _getLoadAttributesSelect

 /**
  * Retrieve attributes load select
  *
  * @param   string $table
  * @return  Mage_Eav_Model_Entity_Collection_Abstract
  */
 protected function _getLoadAttributesSelect($table)
 {
     if ((int) $this->getStoreId()) {
         $entityIdField = $this->getEntity()->getEntityIdField();
         $joinCondition = 'store.attribute_id=default.attribute_id
             AND store.entity_id=default.entity_id
             AND store.store_id=' . (int) $this->getStoreId();
         $select = $this->getConnection()->select()->from(array('default' => $table), array($entityIdField, 'attribute_id', 'default_value' => 'value'))->joinLeft(array('store' => $table), $joinCondition, array('store_value' => 'value', 'value' => new Zend_Db_Expr('IFNULL(store.value, default.value)')))->where('default.entity_type_id=?', $this->getEntity()->getTypeId())->where("default.{$entityIdField} in (?)", array_keys($this->_itemsById))->where('default.attribute_id in (?)', $this->_selectAttributes)->where('default.store_id = 0');
     } else {
         $select = parent::_getLoadAttributesSelect($table)->where('store_id=?', $this->getDefaultStoreId());
     }
     return $select;
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:19,代码来源:Abstract.php

示例2: _getLoadAttributesSelect

    /**
     * Retrieve attributes load select
     *
     * @param string $table
     * @param array|int $attributeIds
     * @return Mage_Eav_Model_Entity_Collection_Abstract
     */
    protected function _getLoadAttributesSelect($table, $attributeIds = array())
    {
        if (empty($attributeIds)) {
            $attributeIds = $this->_selectAttributes;
        }
        $storeId = $this->getStoreId();

        if ($storeId) {

            $adapter        = $this->getConnection();
            $entityIdField  = $this->getEntity()->getEntityIdField();
            $joinCondition  = array(
                't_s.attribute_id = t_d.attribute_id',
                't_s.entity_id = t_d.entity_id',
                $adapter->quoteInto('t_s.store_id = ?', $storeId)
            );
            $select = $adapter->select()
                ->from(array('t_d' => $table), array($entityIdField, 'attribute_id'))
                ->joinLeft(
                    array('t_s' => $table),
                    implode(' AND ', $joinCondition),
                    array())
                ->where('t_d.entity_type_id = ?', $this->getEntity()->getTypeId())
                ->where("t_d.{$entityIdField} IN (?)", array_keys($this->_itemsById))
                ->where('t_d.attribute_id IN (?)', $attributeIds)
                ->where('t_d.store_id = ?', 0);
        } else {
            $select = parent::_getLoadAttributesSelect($table)
                ->where('store_id = ?', $this->getDefaultStoreId());
        }

        return $select;
    }
开发者ID:shashankkanungo,项目名称:magento,代码行数:40,代码来源:__catalog.php

示例3: _getLoadAttributesSelect

 /**
  * Retrieve attributes load select
  *
  * @param   string $table
  * @param   array  $attributeIds
  * @return  Mage_Eav_Model_Entity_Collection_Abstract
  */
 protected function _getLoadAttributesSelect($table, $attributeIds = array())
 {
     $select = parent::_getLoadAttributesSelect($table, $attributeIds);
     if ($this->getStoreId()) {
         $select->where('store_id IN (?)', array(0, $this->getStoreId()));
     } else {
         $select->where('store_id = 0');
     }
     $select->columns(array('store_id' => $table . '.store_id'));
     return $select;
 }
开发者ID:eniuz,项目名称:entitytype-manager,代码行数:18,代码来源:Collection.php


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