*/ class Mage_Eav_Model_Entity_Attribute_Backend_Time_Created extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract { /** * Set created date * * @param Mage_Core_Model_Object $object * @return Mage_Eav_Model_Entity_Attribute_Backend_Time_Created */ public function beforeSave($object) { $attributeCode = $this->getAttribute()->getAttributeCode(); if ($object->isObjectNew() && is_null($object->getData($attributeCode))) { $object->setData($attributeCode, Varien_Date::now()); } return $this; } }