本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}