本文整理汇总了PHP中Mage_Core_Model_Abstract::unsetData方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::unsetData方法的具体用法?PHP Mage_Core_Model_Abstract::unsetData怎么用?PHP Mage_Core_Model_Abstract::unsetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::unsetData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unsetData
public function unsetData($key = null)
{
parent::unsetData($key);
if (is_null($key)) {
$this->_items = null;
}
return $this;
}
示例2: _beforeSave
/**
* Action before save
*
* @param Mage_Core_Model_Abstract $role
* @return Mage_Api_Model_Resource_Roles
*/
protected function _beforeSave(Mage_Core_Model_Abstract $role)
{
if ($role->getId() == '') {
if ($role->getIdFieldName()) {
$role->unsetData($role->getIdFieldName());
} else {
$role->unsetData('id');
}
}
if ($role->getPid() > 0) {
$row = $this->load($role->getPid());
} else {
$row = array('tree_level' => 0);
}
$role->setTreeLevel($row['tree_level'] + 1);
$role->setRoleName($role->getName());
return $this;
}
示例3: _beforeSave
/**
* Set required fields before saving model
*
* @param Mage_Core_Model_Abstract $object
* @return $this
*/
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (!$object->getData('store_ids')) {
$object->setData('store_ids', array(Mage::app()->getStore(true)->getId()));
}
if ($object->getId()) {
$object->getAttributeModel();
$object->unsetData('attribute_id');
}
if (!$this->_pageIsUniqueToStores($object)) {
throw new Exception('A page already exists for this attribute and store combination.');
}
return parent::_beforeSave($object);
}
示例4: _beforeSave
/**
* Apply processing before saving object
*
* @param Mage_Core_Model_Abstract $object
*/
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (!$object->getSlideCode()) {
throw new Exception(Mage::helper('banners')->__('Banner Slides must have a unique code'));
}
$object->setSlideCode($this->formatSlideCode($object->getSlideCode()));
if (Mage::getDesign()->getArea() == 'adminhtml') {
foreach ($object->getData() as $field => $value) {
if (preg_match("/^use_config_([a-zA-Z_]{1,})\$/", $field, $result)) {
$object->setData($result[1], null);
$object->unsetData($field);
}
}
}
return parent::_beforeSave($object);
}
示例5: unsetData
/**
* Unset data from the object.
*
* $key can be a string only. Array will be ignored.
*
* $isChanged will specify if the object needs to be saved after an update.
*
* @param string $key
* @param boolean $isChanged
* @return Mage_Catalog_Model_Abstract
*/
public function unsetData($key = null)
{
if (!is_null($key) && $this->isLockedAttribute($key) || $this->isReadonly()) {
return $this;
}
return parent::unsetData($key);
}
示例6: unsetData
/**
* Unsets the data at the given key.
*
* Overridden to add an $unset operation for when the object is saved.
*
* @param string $key
* @return Cm_Mongo_Model_Abstract
*/
public function unsetData($key = null)
{
if (!is_null($key) && $this->isObjectNew() === FALSE && !isset($this->getResource()->getFieldMappings()->{$key}->required)) {
$this->op('$unset', $key, 1);
}
return parent::unsetData($key);
}
示例7: __construct
protected $_correspondents;
public function __construct($args = array())
{
$this->_init('alekseon_mailTransport/sentEmail');
}