本文整理汇总了PHP中Mage_Core_Model_Abstract::hasCreatedAt方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::hasCreatedAt方法的具体用法?PHP Mage_Core_Model_Abstract::hasCreatedAt怎么用?PHP Mage_Core_Model_Abstract::hasCreatedAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::hasCreatedAt方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _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);
}
示例2: _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);
}
示例3: _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;
}
示例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());
Mage::helper('feedexport/format')->preparePostData($object);
return parent::_beforeSave($object);
}
示例5: _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);
}
示例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());
$conditions = $object->getCondition();
unset($conditions['CID']);
$object->setConditionsSerialized(serialize($conditions));
return parent::_beforeSave($object);
}
示例7: _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);
}
示例8: _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);
}
示例9: _beforeSave
protected function _beforeSave(Mage_Core_Model_Abstract $object)
{
if ($object->isObjectNew() && !$object->hasCreatedAt()) {
$object->setCreatedAt(Mage::getSingleton('core/date')->gmtDate());
}
if (is_array($object->getData('store_ids'))) {
$object->setData('store_ids', implode(',', $object->getData('store_ids')));
}
if (is_array($object->getData('cancellation_event'))) {
$object->setData('cancellation_event', implode(',', $object->getData('cancellation_event')));
}
$object->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate());
if ($object->hasData('rule')) {
$this->_saveRule($object);
}
return parent::_beforeSave($object);
}
示例10: _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->getActiveTo()) {
$object->setActiveTo(str_replace('00:00:00', '23:59:59', $object->getActiveTo()));
//include full day
}
if ($object->getActiveTo() == '') {
$object->setActiveTo(null);
}
if ($object->getActiveFrom() == '') {
$object->setActiveFrom(null);
}
return parent::_beforeSave($object);
}
示例11: _beforeSave
/**
* Before save.
*
* @param Mirasvit_FeedExport_Model_Feed $object
*
* @return $this
*/
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->getIsMassStatus()) {
Mage::helper('feedexport/format')->preparePostData($object);
if (is_array($object->getCronDay())) {
$object->setCronDay(implode(',', $object->getCronDay()));
}
if (is_array($object->getCronTime())) {
$object->setCronTime(implode(',', $object->getCronTime()));
}
if (is_array($object->getNotificationEvents())) {
$object->setNotificationEvents(implode(',', $object->getNotificationEvents()));
}
}
$this->saveRules($object);
return parent::_beforeSave($object);
}