protected function _getLoadSelect($field, $value, $object) { $select = parent::_getLoadSelect($field, $value, $object); // $select->joinInner( // array('etm_entity_type' => $this->getTable('goodahead_etm/eav_entity_type')), // $this->getMainTable() . '.entity_type_id = etm_entity_type.entity_type_id' // ); $select->joinInner(array('etm_attribute' => $this->getTable('goodahead_etm/eav_attribute')), $this->getMainTable() . '.attribute_id = etm_attribute.attribute_id'); return $select; }
/** * Retrieve select object for load object data * * @param string $field * @param mixed $value * @return Zend_Db_Select */ protected function _getLoadSelect($field, $value, $object) { $select = parent::_getLoadSelect($field, $value, $object); if ($object->getWebsite()->getId()) { $columns = array(); $describe = $this->_getReadAdapter()->describeTable($this->getTable('customer/eav_attribute_website')); unset($describe['attribute_id']); foreach (array_keys($describe) as $columnName) { if ($columnName == 'attribute_id') { continue; } $columns['scope_' . $columnName] = $columnName; } $select->joinLeft(array('scope_table' => $this->getTable('customer/eav_attribute_website')), $this->getMainTable() . '.attribute_id = scope_table.attribute_id AND scope_table.website_id = ' . (int) $object->getWebsite()->getId(), $columns); } return $select; }