本文整理汇总了PHP中Mage_Core_Model_Abstract::setCreationTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::setCreationTime方法的具体用法?PHP Mage_Core_Model_Abstract::setCreationTime怎么用?PHP Mage_Core_Model_Abstract::setCreationTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::setCreationTime方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeSave
/**
* Perform operations before object save
*
* @param Mage_Cms_Model_Block $object
* @return Creativestyle_CheckoutByAmazon_Model_Mysql4_Log_Abstract
*/
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (!$object->getId()) {
$object->setCreationTime(Mage::getSingleton('core/date')->gmtDate());
}
return parent::_beforeSave($object);
}
示例2: _beforeSave
/**
* Some processing prior to saving to database - processes the given images
* and the store configuration
*
* @param Mage_Core_Model_Abstract $object Current faq item
*/
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (!$object->getId()) {
$object->setCreationTime(Mage::getSingleton('core/date')->gmtDate());
}
$object->setPublicationTime(Mage::app()->getLocale()->date($object->getPublicationTime(), Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT), null, false)->toString(Varien_Date::DATETIME_INTERNAL_FORMAT));
$object->setUpdateTime(Mage::getSingleton('core/date')->gmtDate());
}
示例3: _beforeSave
/**
*
*
* @param Mage_Core_Model_Abstract $object
*/
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (!$object->getId()) {
$object->setCreationTime(now());
}
$object->setUpdateTime(now());
return $this;
}
示例4: _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);
}
示例5: _beforeSave
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if (!$object->getId()) {
$object->setCreationTime(Mage::getSingleton('core/date')->gmtDate());
}
$object->setUpdateTime(Mage::getSingleton('core/date')->gmtDate());
$object->setContent(serialize($object->getContentDecode()));
return $this;
}
示例6: _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);
}
示例7: _beforeSave
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
*/
foreach (array('custom_theme_from', 'custom_theme_to') as $field) {
$value = !$object->getData($field) ? null : $object->getData($field);
$object->setData($field, $this->formatDate($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);
}