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


PHP Mage_Core_Model_Abstract::getCreatedAt方法代码示例

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


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

示例1: _prepareDataForSave

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

示例2: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getCreatedAt()) {
         $object->setCreatedAt($this->formatDate(time()));
     }
     return parent::_beforeSave($object);
 }
开发者ID:r-martins,项目名称:magento-stock-history,代码行数:7,代码来源:History.php

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

示例4: _beforeSave

 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $date = new Zend_Date();
     if (!$object->getCreatedAt()) {
         $object->setCreatedAt($date->toString(self::DATE_FORMAT));
     }
     $object->setUpdatedAt($date->toString(self::DATE_FORMAT));
     parent::_beforeSave($object);
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:10,代码来源:Form.php

示例5: _beforeSave

 /**
  * Process job data before save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Gpec_Job_Model_Resource_Job
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     /**
      * Update timestamp values
      */
     $date = $this->formatDate(Mage::getModel('core/date')->gmtTimestamp());
     if (!$object->getCreatedAt()) {
         $object->setCreatedAt($date);
     }
     $object->setUpdatedAt($date);
     return parent::_beforeSave($object);
 }
开发者ID:nverhoye,项目名称:mage-compta,代码行数:18,代码来源:Job.php

示例6: _beforeSave

 /**
  * Before save processing
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Enterprise_Staging_Model_Resource_Staging_Action
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     $staging = $object->getStaging();
     if ($staging instanceof Enterprise_Staging_Model_Staging) {
         if ($staging->getId()) {
             $object->setStagingId($staging->getId());
             $object->setStagingWebsiteId($staging->getStagingWebsiteId());
             $object->setMasterWebsiteId($staging->getMasterWebsiteId());
         }
     }
     if (!$object->getId() && !$object->getCreatedAt()) {
         $value = $this->formatDate(time());
         $object->setCreatedAt($value);
     }
     if ($object->getId()) {
         $value = $this->formatDate(time());
         $object->setUpdatedAt($value);
     }
     parent::_beforeSave($object);
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:27,代码来源:Action.php

示例7: getExportFilename

 /**
  * The filename of the exported file.
  *
  * @param  string                   $type  the type of this document like invoice, shipment or creditmemo
  * @param  Mage_Core_Model_Abstract $model the model instance
  *
  * @return string the filename of the exported file
  */
 public function getExportFilename($type, $model)
 {
     $type = !$type ? 'invoice' : $type;
     $pattern = $this->getExportPattern($type);
     if (!$pattern) {
         $date = Mage::getSingleton('core/date');
         $pattern = $type . $date->date('Y-m-d_H-i-s');
     }
     if (substr($pattern, -4) != '.pdf') {
         $pattern = $pattern . '.pdf';
     }
     $path = strftime($pattern, strtotime($model->getCreatedAt()));
     $vars = $this->getModelVars($model);
     return strtr($path, $vars);
 }
开发者ID:codedge,项目名称:firegento-pdf,代码行数:23,代码来源:Data.php

示例8: _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->getDisplayName()) {
         if (!$object->getFrontendLabel()) {
             throw new Exception(Mage::helper('attributeSplash')->__('Splash object must have a name'));
         } else {
             $object->setDisplayName($object->getFrontendLabel());
         }
     }
     if ($object->getCategoryId()) {
         $category = Mage::getModel('catalog/category')->load($object->getCategoryId());
         if (!$category->getId()) {
             $object->setCategoryId(null);
         }
     } else {
         $object->setCategoryId(null);
     }
     if (!$object->getUrlKey()) {
         $object->setUrlKey($object->getname());
     }
     $object->setUrlKey($this->formatUrlKey($object->getUrlKey()));
     $object->setUpdatedAt(now());
     if (!$object->getCreatedAt()) {
         $object->setCreatedAt(now());
     }
     return parent::_beforeSave($object);
 }
开发者ID:Benjamin021,项目名称:magento-attribute-page,代码行数:33,代码来源:Abstract.php

示例9: _beforeSave

 /**
  * Automatically set the created_at datetime. Why not a timestamp? Dunno
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Core_Model_Resource_Db_Abstract|void
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getCreatedAt()) {
         $object->setCreatedAt(new Zend_Db_Expr('NOW()'));
     }
 }
开发者ID:danielholmstrom,项目名称:Made_Queue,代码行数:12,代码来源:Job.php

示例10: _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->getDisplayName()) {
         if (!$object->getFrontendLabel()) {
             throw new Exception(Mage::helper('attributeSplash')->__('Splash object must have a name'));
         } else {
             $object->setDisplayName($object->getFrontendLabel());
         }
     }
     if ($object->getCategoryId()) {
         $category = Mage::getModel('catalog/category')->load($object->getCategoryId());
         if (!$category->getId()) {
             $object->setCategoryId(null);
         }
     } else {
         $object->setCategoryId(null);
     }
     if (!$object->getUrlKey()) {
         $object->setUrlKey($object->getname());
     }
     $object->setUrlKey($this->formatUrlKey($object->getUrlKey()));
     $object->setUpdatedAt(now());
     if (!$object->getCreatedAt()) {
         $object->setCreatedAt(now());
     }
     if (is_array($object->getCustomFields())) {
         $customFields = array();
         foreach ($object->getCustomFields() as $field => $value) {
             if (trim($value) !== '') {
                 $customFields[$field] = $value;
             }
         }
         if (count($customFields) > 0) {
             $object->setCustomFields(serialize($customFields));
         } else {
             $object->setCustomFIelds('');
         }
     }
     return parent::_beforeSave($object);
 }
开发者ID:sreichel,项目名称:magento-Fishpig-Attribute-Splash-Pages,代码行数:46,代码来源:Abstract.php


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