Exemple #1
0
 /**
  * Prepare datetime attribute value
  *
  * Backward compatibility with versions < 1.13.0.0
  *
  * @param mixed $value
  * @param Varien_Object $object
  * @return mixed
  */
 protected function _prepareDatetimeValue($value, $object)
 {
     // just use the parent in case the method change in future versions
     if (method_exists(get_parent_class($this), '_prepareDatetimeValue')) {
         return parent::_prepareDatetimeValue($value, $object);
     }
     // reproduce functionality from 1.13
     $attribute = $object->getResource()->getAttribute($this->getAttribute());
     if ($attribute && $attribute->getBackendType() == 'datetime') {
         $value = strtotime($value);
     }
     return $value;
 }