Created
December 4, 2014 11:02
-
-
Save aleron75/25c450bc5e1f33158f18 to your computer and use it in GitHub Desktop.
_beforeSave() on Magento Models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function _beforeSave() | |
{ | |
$this->setUpdatedAt(Mage::getSingleton('core/date')->gmtDate()); | |
if ($this->isObjectNew() && null === $this->getCreatedAt()) { | |
$this->setCreatedAt(Mage::getSingleton('core/date')->gmtDate()); | |
} | |
return parent::_beforeSave(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment