/** * Enter description here ... * @param Mana_Db_Model_Virtual_Result $result * @param Varien_Db_Select $select * @param array $columns */ protected function _addVirtualColumns($result, $select, $columns = null) { $globalEntityName = Mage::helper('mana_db')->getGlobalEntityName($this->getEntityName()); if (!$columns || in_array('code', $columns)) { Mage::helper('mana_db')->joinLeft($select, 'global', Mage::getSingleton('core/resource')->getTableName($globalEntityName), 'main_table.global_id = global.id'); $select->columns("global.code AS code"); $result->addColumn('code'); } if (!$columns || in_array('type', $columns)) { Mage::helper('mana_db')->joinLeft($select, 'global', Mage::getSingleton('core/resource')->getTableName($globalEntityName), 'main_table.global_id = global.id'); $select->columns("global.type AS type"); $result->addColumn('type'); } }
/** * Enter description here ... * @param Mana_Db_Model_Virtual_Result $result * @param Varien_Db_Select $select * @param array $columns */ protected function _addVirtualColumns($result, $select, $columns = null) { $globalEntityName = Mage::helper('mana_db')->getGlobalEntityName($this->getEntityName()); if (!$columns || in_array('code', $columns)) { Mage::helper('mana_db')->joinLeft($select, 'global', Mage::getSingleton('core/resource')->getTableName($globalEntityName), $this->getMainTable() . '.global_id = global.id'); $select->columns("global.code AS code"); $result->addColumn('code'); } if (!$columns || in_array('type', $columns)) { Mage::helper('mana_db')->joinLeft($select, 'global', Mage::getSingleton('core/resource')->getTableName($globalEntityName), $this->getMainTable() . '.global_id = global.id'); $select->columns("global.type AS type"); $result->addColumn('type'); } if ($this->coreHelper()->isManadevDependentFilterInstalled()) { $this->getDependentFilterVirtualColumnsResource()->addToModel($this, $select, $result, $columns, $globalEntityName); } }