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


PHP Mage_Core_Model_Abstract::isObjectNew方法代码示例

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


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

示例1: _beforeSave

 /**
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew()) {
         $object->setCreatedAt($this->formatDate(true));
     }
     return parent::_beforeSave($object);
 }
开发者ID:sergeifilippov,项目名称:magento-slack,代码行数:11,代码来源:Queue.php

示例2: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     if (is_array($object->getAttr())) {
         $object->setAttr(serialize($object->getAttr()));
     }
     if (!$object->getChildrenCount()) {
         $object->setChildrenCount(0);
     }
     if ($object->getLevel() === null) {
         $object->setLevel(1);
     }
     if (!$object->getId()) {
         $object->setPosition($this->_getMaxPosition($object->getPath()) + 1);
         $path = explode('/', $object->getPath());
         $level = count($path);
         $object->setLevel($level + 1);
         if ($object->getParentId() == null) {
             $object->setLevel(1);
         }
         $object->setPath($object->getPath() . '/');
         $toUpdateChild = explode('/', $object->getPath());
         $this->_getWriteAdapter()->update($this->getTable('item'), array('children_count' => new Zend_Db_Expr('children_count + 1')), array('item_id IN(?)' => $toUpdateChild));
     }
     if ($object->getParentId() == 0) {
         $object->setParentId(null);
     }
     return parent::_beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:32,代码来源:Glace_Menu_Model_Resource_Item.php

示例3: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     return parent::_beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:7,代码来源:Mirasvit_Fpc_Model_Resource_Log.php

示例4: _beforeSave

 /**
  * Check before save is object is new and set a flag
  * 
  * @param Mage_Core_Model_Abstract $object
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && $object->getSaveMzaxGoalReferences() === null) {
         // only if object is new
         $object->setSaveMzaxGoalReferences(true);
     }
 }
开发者ID:jsiefer,项目名称:emarketing,代码行数:12,代码来源:Goal.php

示例5: _prepareDataForSave

 /**
  * Set and update created at and updated at dates before saving the model.
  *
  * @param Mage_Core_Model_Abstract $object
  * @return array
  */
 protected function _prepareDataForSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getId() || $object->isObjectNew()) {
         $object->setCreatedAt(now());
     }
     $object->setUpdatedAt(now());
     $data = parent::_prepareDataForSave($object);
     return $data;
 }
开发者ID:xiaoguizhidao,项目名称:extensiongsd,代码行数:15,代码来源:Abstract.php

示例6: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     Mage::helper('feedexport/format')->preparePostData($object);
     return parent::_beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:9,代码来源:Template.php

示例7: _beforeSave

 /**
  * Set template type, added at and modified at time
  *
  * @param Mage_Core_Model_Email_Template $object
  * @return Mage_Core_Model_Resource_Email_Template
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew()) {
         $object->setCreatedAt($this->formatDate(true));
     }
     $object->setModifiedAt($this->formatDate(true));
     $object->setTemplateType((int) $object->getTemplateType());
     return parent::_beforeSave($object);
 }
开发者ID:njaeger,项目名称:magento_github,代码行数:15,代码来源:Template.php

示例8: _beforeSave

 /**
  * Process category data before saving
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Zeon_Faq_Model_Mysql4_Category
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     // modify create / update dates
     if ($object->isObjectNew() && !$object->hasCreationTime()) {
         $object->setCreationTime(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdateTime(Mage::getSingleton('core/date')->gmtDate());
     return parent::_beforeSave($object);
 }
开发者ID:Jonathonbyrd,项目名称:Optimized-Magento-1.9.x,代码行数:15,代码来源:Category.php

示例9: _beforeSave

 /**
  * Prepare object data for saving
  *
  * @param Mage_Core_Model_Email_Queue|Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Email_Queue
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew()) {
         $object->setCreatedAt($this->formatDate(true));
     }
     $object->setMessageBodyHash(md5($object->getMessageBody()));
     $object->setMessageParameters(serialize($object->getMessageParameters()));
     return parent::_beforeSave($object);
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:15,代码来源:Queue.php

示例10: _prepareDataForSave

 /**
  * Prepare data for save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return array
  */
 protected function _prepareDataForSave(Mage_Core_Model_Abstract $object)
 {
     $currentTime = Varien_Date::now();
     if ((!$object->getId() || $object->isObjectNew()) && !$object->getCreatedAt()) {
         $object->setCreatedAt($currentTime);
     }
     $object->setUpdatedAt($currentTime);
     $data = parent::_prepareDataForSave($object);
     return $data;
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:16,代码来源:Abstract.php

示例11: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getLevel()) {
         $object->getLevel(Mirasvit_MstCore_Model_Logger::LOG_LEVEL_NOTICE);
     }
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     return parent::_beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:10,代码来源:Mirasvit_MstCore_Model_Resource_Logger.php

示例12: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     $conditions = $object->getCondition();
     unset($conditions['CID']);
     $object->setConditionsSerialized(serialize($conditions));
     return parent::_beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:11,代码来源:Attribute.php

示例13: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     if ($object->getData('mapping') && is_array($object->getData('mapping'))) {
         $object->setData('mapping_serialized', serialize($object->getData('mapping')));
     }
     return parent::_beforeSave($object);
 }
开发者ID:vinayshuklasourcefuse,项目名称:sareez,代码行数:11,代码来源:Category.php

示例14: _beforeSave

 /**
  * Process popup data before saving
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Etailers_Popup_Model_Resource_Popup
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     /*
      * For two attributes which represent timestamp data in DB
      * we should make converting such as:
      * If they are empty we need to convert them into DB
      * type NULL so in DB they will be empty and not some default value
      */
     // modify create / update dates
     if ($object->isObjectNew() && !$object->hasCreationTime()) {
         $object->setCreationTime(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdateTime(Mage::getSingleton('core/date')->gmtDate());
     return parent::_beforeSave($object);
 }
开发者ID:purpleweb,项目名称:magento-popup,代码行数:21,代码来源:Popup.php

示例15: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if ($object->isObjectNew() && !$object->hasCreatedAt()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     if (!$object->hasStatus()) {
         $object->setStatus(Mirasvit_Email_Model_Queue::STATUS_PENDING)->setStatusMessage('Assignment of default status');
     }
     if ($object->hasData('args')) {
         $object->setArgsSerialized(serialize($object->getData('args')));
     }
     $this->_processHistory($object);
     $object->setUniqKeyMd5(md5($object->getUniqKey()));
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     return parent::_beforeSave($object);
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:16,代码来源:Queue.php


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