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


PHP Mage_Core_Model_Abstract::setUpdatedAt方法代码示例

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


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

示例1: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $object->validate();
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     if ($object->getAttributes() && is_array($object->getAttributes())) {
         $object->setAttributesSerialized(serialize($object->getAttributes()));
     }
     if ($object->getProperties() && is_array($object->getProperties())) {
         $object->setPropertiesSerialized(serialize($object->getProperties()));
     }
     if ($object->getData('attributes_serialized') != $object->getOrigData('attributes_serialized')) {
         $object->setStatus(2);
     }
     if ($object->getData('properties_serialized') != $object->getOrigData('properties_serialized')) {
         $object->setStatus(2);
     }
     if (!$object->getId() && !$object->getIndexInstance()->isAllowMultiInstance()) {
         //check if this index already exists
         $collection = Mage::getModel('searchindex/index')->getCollection()->addFieldToFilter('index_code', $object->getIndexCode());
         if ($collection->count() > 0) {
             Mage::throwException('The index for current content type already exists');
         }
     }
     return parent::_beforeSave($object);
 }
开发者ID:vishalpatel14,项目名称:indiankalaniketan,代码行数:25,代码来源:Index.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

 /**
  * Perform operations before object save
  *
  * @param Mage_Cms_Model_Block $object
  * @return Mage_Cms_Model_Resource_Block
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getId()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     return $this;
 }
开发者ID:OurLaborisJoy,项目名称:FireGento_FlexCms,代码行数:14,代码来源:Content.php

示例4: _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());
     return parent::_beforeSave($object);
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:8,代码来源:Unsubscription.php

示例5: _beforeSave

 /**
  * Before save callback, set <created_at> and <updated_at> values
  *
  * @param Mage_Core_Model_Abstract $object
  * @return void
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getCreatedAt()) {
         $object->setCreatedAt($this->formatDate(time()));
     }
     $object->setUpdatedAt($this->formatDate(time()));
     parent::_beforeSave($object);
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:14,代码来源:Export.php

示例6: _beforeSave

 /**
  * Sets various dates before the model is saved.
  *
  * @param Mage_Core_Model_Abstract $object
  * @return $this
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->hasCreatedAt()) {
         $object->setCreatedAt($this->_getDateModel()->gmtDate('Y-m-d H:i:s'));
     }
     $object->setUpdatedAt($this->_getDateModel()->gmtDate('Y-m-d H:i:s'));
     return $this;
 }
开发者ID:shabirm,项目名称:avatax,代码行数:14,代码来源:Queue.php

示例7: _prepareDataForSave

 /**
  * Prepare data for save
  *
  * @param   Mage_Core_Model_Abstract $object
  * @return  array
  */
 protected function _prepareDataForSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getId()) {
         $object->setCreatedAt(now());
     }
     $object->setUpdatedAt(now());
     $data = parent::_prepareDataForSave($object);
     return $data;
 }
开发者ID:jsiefer,项目名称:emarketing,代码行数:15,代码来源:Variation.php

示例8: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     /** @var  Mirasvit_Helpdesk_Model_Status $object */
     if (!$object->getId()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     return parent::_beforeSave($object);
 }
开发者ID:cesarfelip3,项目名称:clevermage_new,代码行数:9,代码来源:Status.php

示例9: _beforeSave

 /**
  * Set created_at and updated_at before saving entity
  *
  * @param Mage_Core_Model_Abstract $crawler
  * @return Maverick_Crawler_Model_Resource_Crawler
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $crawler)
 {
     $date = Mage::getSingleton('core/date')->date('Y-m-d H:i:s');
     if (!$crawler->getId()) {
         $crawler->setCreatedAt($date);
     }
     $crawler->setUpdatedAt($date);
     return $this;
 }
开发者ID:JoniRambro,项目名称:magento-full-page-cache-crawler,代码行数:15,代码来源:Crawler.php

示例10: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     foreach ($this->_serializedAttr as $attrCode) {
         if (is_array($object->getData($attrCode))) {
             $object->setData($attrCode, serialize($object->getData($attrCode)));
         }
     }
     $now = Varien_Date::now(false);
     $object->setUpdatedAt($now);
 }
开发者ID:tschifftner,项目名称:Magento-MEP,代码行数:10,代码来源:Profile.php

示例11: _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

示例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());
     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

示例13: _prepareDataForSave

 protected function _prepareDataForSave(Mage_Core_Model_Abstract $object)
 {
     if ($this->_isPkAutoIncrement && !$object->getId()) {
         $object->setCreatedAt(now());
     } else {
         $object->setCreatedAt(now());
     }
     $object->setUpdatedAt(now());
     $data = parent::_prepareDataForSave($object);
     return $data;
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:11,代码来源:Abstract.php

示例14: _beforeSave

 /**
  * Process comment data before saving
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Cms_Model_Resource_Page
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     // modify create / update dates
     if ($object->isObjectNew() && !$object->hasCreationTime()) {
         $object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
     }
     $object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
     $session = Mage::getSingleton('core/session');
     $object->setPathUrl($session->getRefererUrl());
     return parent::_beforeSave($object);
 }
开发者ID:jahvi,项目名称:magento-study-group,代码行数:17,代码来源:Comment.php

示例15: _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


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