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


PHP Mage_Core_Model_Mysql4_Collection_Abstract::_beforeLoad方法代码示例

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


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

示例1: _beforeLoad

 /**
  * 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();
 }
开发者ID:booklein,项目名称:bookle,代码行数:12,代码来源:Collection.php

示例2: _beforeLoad

 /**
  *
  *
  * (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;
 }
开发者ID:rajarshc,项目名称:Rooja,代码行数:14,代码来源:Collection.php

示例3: _beforeLoad

 /**
  * 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();
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:17,代码来源:Collection.php

示例4: _beforeLoad

 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;
 }
开发者ID:xiaoguizhidao,项目名称:ortodon,代码行数:15,代码来源:Collection.php

示例5: _beforeLoad

 /**
  * 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();
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:67,代码来源:Collection.php

示例6: _beforeLoad

 /**
  * After load processing - adds store information to the datasets
  *
  */
 protected function _beforeLoad()
 {
     parent::_beforeLoad();
 }
开发者ID:booklein,项目名称:bookle,代码行数:8,代码来源:Collection.php

示例7: _beforeLoad

 protected function _beforeLoad()
 {
     $this->_renderEditFilter();
     parent::_beforeLoad();
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:cupboardglasspipes.ecomitize.com,代码行数:6,代码来源:Collection.php

示例8: _beforeLoad

 /**
  * 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();
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:10,代码来源:Collection.php

示例9: _beforeLoad

 public function _beforeLoad()
 {
     $this->getSelect()->group('option_id');
     return parent::_beforeLoad();
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:5,代码来源:Collection.php

示例10: _beforeLoad

 /**
  * limit core/conifg_data collection to shopgate shopnumber related items
  * 
  * @return void
  */
 protected function _beforeLoad()
 {
     $this->_filterShopgateShopNumbers();
     parent::_beforeLoad();
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:10,代码来源:Collection.php


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