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


PHP Mage_Core_Model_Abstract::getCollection方法代码示例

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


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

示例1: getCollection

 public function getCollection()
 {
     $collection = parent::getCollection();
     // adiciona os campos de nome dos enderecos de entrega e fatura
     $collection->getSelect()->joinLeft(array('order_table' => $collection->getTable('sales/order')), "(main_table.order_id = order_table.entity_id)", array("order_table.increment_id", "order_table.grand_total"), null);
     return $collection;
 }
开发者ID:netun0,项目名称:magento-maxima-boleto,代码行数:7,代码来源:Slip.php

示例2: getChildren

 public function getChildren(Mage_Core_Model_Abstract $object)
 {
     /** @var Magpleasure_Common_Model_Resource_Treeview_Collection_Abstract $collection */
     $collection = $object->getCollection();
     $collection->addFieldToFilter($this->getParentIdField(), $object->getData($this->getParentIdField()))->setOrder($this->getPositionField(), 'ASC');
     return $collection;
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:7,代码来源:Abstract.php

示例3: _checkUniqueFields

 protected function _checkUniqueFields(Mage_Core_Model_Abstract $objectToSave)
 {
     $collection = $objectToSave->getCollection()->addFieldToFilter('direction', $objectToSave->getDirection());
     foreach ($collection as $item) {
         if ($item->getId() == $objectToSave->getId()) {
             continue;
         }
         $this->_afterLoad($item);
         $customerGroupUniqueFlag = true;
         foreach ($objectToSave->getData('customer_group_ids') as $objectToSaveCustomerGroupId) {
             if (in_array($objectToSaveCustomerGroupId, $item->getData('customer_group_ids'))) {
                 $customerGroupUniqueFlag = false;
                 break;
             }
         }
         $websiteUniqueFlag = true;
         foreach ($objectToSave->getData('website_ids') as $objectToSaveWebsiteId) {
             if (in_array($objectToSaveWebsiteId, $item->getData('website_ids'))) {
                 $websiteUniqueFlag = false;
                 break;
             }
         }
         if (!$customerGroupUniqueFlag && !$websiteUniqueFlag) {
             throw new Exception();
         }
     }
 }
开发者ID:HPTTeam,项目名称:hackathon,代码行数:27,代码来源:Rate.php

示例4: getCollection

 public function getCollection()
 {
     $store_id = $this->getStoreId();
     if (!$store_id) {
         return parent::getCollection();
     }
     $collection = Mage::getResourceModel('faq/categorystore_collection')->addFieldToFilter('store_id', $store_id)->addFieldToFilter("status", 1)->setOrder("ordering", "ASC")->setOrder("name", "ASC");
     return $collection;
 }
开发者ID:Thinlt,项目名称:simicart,代码行数:9,代码来源:Category.php

示例5: _loadExistingModel

 /**
  * Load a model by attribute code
  *
  * @param  Mage_Core_Model_Abstract $model
  * @param  string                   $attributeCode
  * @param  string                   $value
  * @return Mage_Core_Model_Abstract
  */
 protected function _loadExistingModel($model, $attributeCode, $value)
 {
     foreach ($model->getCollection() as $singleModel) {
         if ($singleModel->getData($attributeCode) == $value) {
             $model->load($singleModel->getId());
             return $model;
         }
     }
     return $model;
 }
开发者ID:hsq,项目名称:Ho_Setup,代码行数:18,代码来源:Abstract.php

示例6: getCollection

 /**
  * Retrieve resource collection instance wrapper
  *
  * @return Mage_Eav_Model_Mysql4_Form_Element_Collection
  */
 public function getCollection()
 {
     return parent::getCollection();
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:9,代码来源:Element.php

示例7: getCollection

 public function getCollection()
 {
     return parent::getCollection()->getAvailable();
 }
开发者ID:CherylMuniz,项目名称:fashion,代码行数:4,代码来源:Giftvoucher.php

示例8: loadByFewFields

 /**
  * Load Absctract Collection by few key fields
  *
  * @param Mage_Core_Model_Abstract $object
  * @param array $data
  * @return Magpleasure_Common_Model_Resource_Abstract
  */
 public function loadByFewFields(Mage_Core_Model_Abstract $object, array $data)
 {
     /** @var $collection Mage_Core_Model_Resource_Db_Collection_Abstract */
     $collection = $object->getCollection();
     if ($collection) {
         foreach ($data as $field => $value) {
             $collection->addFieldToFilter($field, $value);
         }
         foreach ($collection as $item) {
             /** @var $item Mage_Core_Model_Abstract */
             if ($itemId = $item->getId()) {
                 $itemModel = Mage::getModel($object->getResourceName())->load($itemId);
                 $object->setData($itemModel->getData());
             }
         }
     }
     return $this;
 }
开发者ID:protechhelp,项目名称:gamamba,代码行数:25,代码来源:Abstract.php

示例9: _getObjectInstanceFromCollection

 /**
  * @param \Mage_Core_Model_Abstract $model
  * @param array $columns
  * @param array $values
  * @return \Mage_Core_Model_Abstract
  */
 private function _getObjectInstanceFromCollection(\Mage_Core_Model_Abstract $model, $columns, $values)
 {
     $collection = $model->getCollection();
     $amountOfColumns = count($columns);
     for ($i = 0; $i < $amountOfColumns; $i++) {
         if (isset($columns[$i]) && isset($values[$i])) {
             $collection->addFieldToFilter($columns[$i], $values[$i]);
         } else {
             return null;
         }
     }
     $item = $collection->getFirstItem();
     return !$item && !$item->getId() ? null : $item;
 }
开发者ID:pawlik,项目名称:magerun-addons,代码行数:20,代码来源:Parser.php


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