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


PHP Mage_Core_Model_Abstract::addData方法代码示例

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


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

示例1: addData

 public function addData(array $data)
 {
     if (isset($data['name']) && strpos($data['name'], 'a:') !== 0) {
         $this->setName($data['name']);
         unset($data['name']);
     }
     return parent::addData($data);
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:8,代码来源:Mirasvit_Helpdesk_Model_Priority.php

示例2: addData

 public function addData(array $data)
 {
     if (isset($data['name']) && strpos($data['name'], 'a:') !== 0) {
         $this->setName($data['name']);
         unset($data['name']);
     }
     if (isset($data['description']) && strpos($data['description'], 'a:') !== 0) {
         $this->setDescription($data['description']);
         unset($data['description']);
     }
     if (isset($data['values']) && strpos($data['values'], 'a:') !== 0) {
         $this->setValues($data['values']);
         unset($data['values']);
     }
     return parent::addData($data);
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:16,代码来源:Mirasvit_Helpdesk_Model_Field.php

示例3: _afterLoad

 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($object->getId()) {
         $read = $this->_getReadAdapter();
         if ($object->getType() == BL_CustomGrid_Model_Options_Source::SOURCE_TYPE_MAGE_MODEL) {
             // Load corresponding model
             $query = $read->select()->from($this->getTable('customgrid/options_source_model'))->where('source_id = ?', $object->getId());
             if ($model = $read->fetchRow($query)) {
                 $object->addData($model);
             }
         } else {
             // Load corresponding options
             $query = $read->select()->from($this->getTable('customgrid/options_source_option'))->where('source_id = ?', $object->getId());
             $options = $read->fetchAll($query);
             $object->setData('options', is_array($options) ? $options : array());
         }
     }
     return parent::_afterLoad($object);
 }
开发者ID:aram93,项目名称:mage-enhanced-admin-grids,代码行数:19,代码来源:Source.php

示例4: attachAttributeData

 /**
  * Attach extended data to sales object
  *
  * @param Mage_Core_Model_Abstract $sales
  * @return Enterprise_Customer_Model_Sales_Abstract
  */
 public function attachAttributeData(Mage_Core_Model_Abstract $sales)
 {
     $sales->addData($this->getData());
     return $this;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:11,代码来源:Abstract.php

示例5: _postSaveFieldsUpdate

 /**
  * Update field in table if model have been already saved
  *
  * @param Mage_Core_Model_Abstract $object
  * @param array $data
  * @return Mage_Sales_Model_Resource_Order_Abstract
  */
 protected function _postSaveFieldsUpdate($object, $data)
 {
     if ($object->getId() && !empty($data)) {
         $table = $this->getMainTable();
         $this->_getWriteAdapter()->update($table, $data, array($this->getIdFieldName() . '=?' => (int) $object->getId()));
         $object->addData($data);
     }
     return $this;
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:16,代码来源:Abstract.php

示例6: _afterLoad

 /**
  * Load additional attribute data.
  * Load label of current active store
  *
  * @param Mage_Eav_Model_Entity_Attribute|Mage_Core_Model_Abstract $object
  * @return Mage_Eav_Model_Resource_Entity_Attribute
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     /** @var $entityType Mage_Eav_Model_Entity_Type */
     $entityType = $object->getData('entity_type');
     if ($entityType) {
         $additionalTable = $entityType->getAdditionalAttributeTable();
     } else {
         $additionalTable = $this->getAdditionalAttributeTable($object->getEntityTypeId());
     }
     if ($additionalTable) {
         $adapter = $this->_getReadAdapter();
         $bind = array(':attribute_id' => $object->getId());
         $select = $adapter->select()->from($this->getTable($additionalTable))->where('attribute_id = :attribute_id');
         $result = $adapter->fetchRow($select, $bind);
         if ($result) {
             $object->addData($result);
         }
     }
     return $this;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:27,代码来源:Attribute.php

示例7: _afterLoad

 /**
  * Load additional attribute data.
  * Load label of current active store
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Mysql4_Entity_Attribute
  */
 protected function _afterLoad(Mage_Core_Model_Abstract $object)
 {
     if ($entityType = $object->getData('entity_type')) {
         $additionalTable = $entityType->getAdditionalAttributeTable();
     } else {
         $additionalTable = $this->getAdditionalAttributeTable($object->getEntityTypeId());
     }
     if ($additionalTable) {
         $select = $this->_getReadAdapter()->select()->from($this->getTable($additionalTable))->where('attribute_id = ?', $object->getId());
         if ($result = $this->_getReadAdapter()->fetchRow($select)) {
             $object->addData($result);
         }
     }
     return $this;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:22,代码来源:Attribute.php

示例8: saveProductType

 public function saveProductType(Mage_Core_Model_Abstract $productType, array $data)
 {
     $productTypeData = array('product_type_id' => $data['id'], 'version' => $data['version'], 'name' => $data['name'], 'description' => $data['description'], 'product_class_ids' => $data['productClassIds'], 'locale_code' => $this->getLocaleCode());
     $productType->addData($productTypeData)->save();
     return $this;
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:6,代码来源:Response.php


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