本文整理汇总了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;
}
示例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;
}
示例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;
}