コード例 #1
0
ファイル: Collection.php プロジェクト: booklein/bookle
 /**
  * After load processing - adds store information to the datasets
  *
  */
 protected function _beforeLoad()
 {
     $store_id = Mage::app()->getStore()->getId();
     if ($store_id) {
         $this->addStoreFilter($store_id);
     }
     parent::_beforeLoad();
 }
コード例 #2
0
ファイル: Collection.php プロジェクト: rajarshc/Rooja
 /**
  *
  *
  * (overrides parent method)
  */
 protected function _beforeLoad()
 {
     parent::_beforeLoad();
     if (!$this->_excludeTransferReferences) {
         // Add a simplified version of the transfer references (1 reference per 1 transfer)
         $this->_addTransferReferences($this->_getSingleReferenceSelect());
     }
     return $this;
 }
コード例 #3
0
ファイル: Collection.php プロジェクト: jpbender/mage_virtual
 /**
  * Join website table if needed before load
  *
  * @return Enterprise_CustomerSegment_Model_Mysql4_Segment_Collection
  */
 protected function _beforeLoad()
 {
     $isFilteredByWebsite = $this->getFlag('is_filtered_by_website');
     $isOrderedByWebsite = array_key_exists('website_ids', $this->_orders);
     if (($isFilteredByWebsite || $isOrderedByWebsite) && !$this->getFlag('is_website_table_joined')) {
         $this->setFlag('is_website_table_joined', true);
         $join = $isFilteredByWebsite ? 'joinInner' : 'joinLeft';
         $cols = $isOrderedByWebsite ? array('website_ids' => 'website.website_id') : array();
         $this->getSelect()->{$join}(array('website' => $this->getTable('enterprise_customersegment/website')), 'main_table.segment_id = website.segment_id', $cols);
     }
     return parent::_beforeLoad();
 }
コード例 #4
0
ファイル: Collection.php プロジェクト: xiaoguizhidao/ortodon
 protected function _beforeLoad()
 {
     if (!count($this->_columns) || isset($this->_columns['*'])) {
         $this->getSelect()->columns('main_table.*');
         $this->addVirtualColumns($this->getSelect());
     } else {
         $virtualColumns = $this->addVirtualColumns($this->getSelect(), $this->_columns);
         foreach (array_diff($this->_columns, $virtualColumns) as $column) {
             $this->getSelect()->columns('main_table.' . $column);
         }
     }
     $this->_renderEditFilter();
     parent::_beforeLoad();
     return $this;
 }
コード例 #5
0
ファイル: Collection.php プロジェクト: jpbender/mage_virtual
 /**
  * Add joins to select
  *
  * @return Mage_Customer_Model_Entity_Form_Attribute_Collection
  */
 protected function _beforeLoad()
 {
     $entityType = $this->getEntityType();
     $this->setItemObjectClass($entityType->getAttributeModel());
     $eaColumns = array();
     $caColumns = array();
     $saColumns = array();
     $eaDescribe = $this->getConnection()->describeTable($this->getTable('eav/attribute'));
     foreach (array_keys($eaDescribe) as $columnName) {
         if ($columnName == 'attribute_id') {
             continue;
         }
         $eaColumns[$columnName] = $columnName;
     }
     $this->_select->join(array('ea' => $this->getTable('eav/attribute')), 'main_table.attribute_id = ea.attribute_id', $eaColumns);
     // join additional attribute data table
     $additionalTable = $entityType->getAdditionalAttributeTable();
     if ($additionalTable) {
         $caDescribe = $this->getConnection()->describeTable($this->getTable($additionalTable));
         foreach (array_keys($caDescribe) as $columnName) {
             if ($columnName == 'attribute_id') {
                 continue;
             }
             $caColumns[$columnName] = $columnName;
         }
         $this->_select->join(array('ca' => $this->getTable($additionalTable)), 'main_table.attribute_id = ca.attribute_id', $caColumns);
     }
     // add scope values
     $saDescribe = $this->getConnection()->describeTable($this->getTable('customer/eav_attribute_website'));
     foreach (array_keys($saDescribe) as $columnName) {
         if ($columnName == 'attribute_id') {
             continue;
         } else {
             if ($columnName == 'website_id') {
                 $saColumns['scope_website_id'] = $columnName;
             } else {
                 if (isset($eaColumns[$columnName])) {
                     $code = sprintf('scope_%s', $columnName);
                     $saColumns[$code] = new Zend_Db_Expr(sprintf('IFNULL(sa.%s, ea.%s)', $columnName, $columnName));
                 } else {
                     if (isset($caColumns[$columnName])) {
                         $code = sprintf('scope_%s', $columnName);
                         $saColumns[$code] = new Zend_Db_Expr(sprintf('IFNULL(sa.%s, ca.%s)', $columnName, $columnName));
                     }
                 }
             }
         }
     }
     $store = $this->getStore();
     $this->_select->joinLeft(array('sa' => $this->getTable('customer/eav_attribute_website')), 'main_table.attribute_id = sa.attribute_id AND sa.website_id = :scope_website_id', $saColumns);
     $this->addBindParam(':scope_website_id', $store->getWebsiteId());
     // add store attribute label
     if ($store->isAdmin()) {
         $this->_select->columns(array('store_label' => 'ea.frontend_label'));
     } else {
         $this->_select->joinLeft(array('al' => $this->getTable('eav/attribute_label')), 'al.attribute_id = main_table.attribute_id AND al.store_id = :label_store_id', array('store_label' => new Zend_Db_Expr('IFNULL(al.value, ea.frontend_label)')));
         $this->addBindParam(':label_store_id', $store->getId());
     }
     // add entity type filter
     $this->_select->where('ea.entity_type_id = ?', (int) $entityType->getId());
     return parent::_beforeLoad();
 }
コード例 #6
0
ファイル: Collection.php プロジェクト: booklein/bookle
 /**
  * After load processing - adds store information to the datasets
  *
  */
 protected function _beforeLoad()
 {
     parent::_beforeLoad();
 }
コード例 #7
0
 protected function _beforeLoad()
 {
     $this->_renderEditFilter();
     parent::_beforeLoad();
     return $this;
 }
コード例 #8
0
ファイル: Collection.php プロジェクト: jpbender/mage_virtual
 /**
  * Before collection load
  *
  * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Flat_Collection
  */
 protected function _beforeLoad()
 {
     Mage::dispatchEvent($this->_eventPrefix . '_load_before', array($this->_eventObject => $this));
     return parent::_beforeLoad();
 }
コード例 #9
0
 public function _beforeLoad()
 {
     $this->getSelect()->group('option_id');
     return parent::_beforeLoad();
 }
コード例 #10
0
ファイル: Collection.php プロジェクト: buttasg/cowgirlk
 /**
  * limit core/conifg_data collection to shopgate shopnumber related items
  * 
  * @return void
  */
 protected function _beforeLoad()
 {
     $this->_filterShopgateShopNumbers();
     parent::_beforeLoad();
 }