Example #1
0
 /**
  * After load method
  *
  * @param  Varien_Object $object Object Model
  * @return FireGento_DynamicCategory_Model_Entity_Attribute_Backend_Rule Self.
  */
 public function afterLoad($object)
 {
     parent::afterLoad($object);
     $attrCode = $this->getAttribute()->getAttributeCode();
     $object->setData($attrCode, unserialize($object->getData($attrCode)));
     return $this;
 }
Example #2
0
 /**
  * Convert create date from UTC to current store time zone
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Time_Created
  */
 public function afterLoad($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $date = $object->getData($attributeCode);
     $zendDate = Mage::app()->getLocale()->storeDate(null, $date, true);
     $object->setData($attributeCode, $zendDate->getIso());
     parent::afterLoad($object);
     return $this;
 }
 public function afterLoad($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $data = $object->getData($attributeCode);
     if (!is_array($data)) {
         $object->setData($attributeCode, @unserialize($data));
     }
     return parent::afterLoad($object);
 }
 /**
  * Decrypts the value after load
  *
  * @param  Mage_Core_Model_Abstract $object Object
  * @return Itabs_Debit_Model_Entity_Customer_Attribute_Backend_Encrypted
  */
 public function afterLoad($object)
 {
     $helper = Mage::helper('core');
     $attributeName = $this->getAttribute()->getName();
     if ($object->getData($attributeName) != '') {
         $value = $helper->decrypt($object->getData($attributeName));
         $object->setData($attributeName, $value);
     }
     return parent::afterLoad($object);
 }
Example #5
0
 public function afterLoad($object)
 {
     $attributeCode = $this->getAttribute()->getName();
     if ($attributeCode == self::ATTRIBUTE_CODE) {
         $data = $object->getData($attributeCode);
         if (!is_array($data)) {
             $object->setData($attributeCode, explode(',', $data));
         }
     }
     parent::afterLoad($object);
 }
Example #6
0
 public function afterLoad($object)
 {
     parent::afterLoad($object);
     if (!$this->_isEnabled()) {
         return;
     }
     $attrCode = $this->getAttribute()->getAttributeCode();
     $defValue = $this->getDefaultValue();
     if (!$object->getData($attrCode) && $defValue) {
         $object->setData($attrCode, $defValue);
     }
 }
Example #7
0
 /**
  * Unserialize after loading
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Serialized
  */
 public function afterLoad($object)
 {
     parent::afterLoad($object);
     $this->_unserialize($object);
     return $this;
 }
Example #8
0
 /**
  * Set category ids to product data
  *
  * @param Mage_Catalog_Model_Product $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function afterLoad($object)
 {
     $object->setData($this->getAttribute()->getAttributeCode(), $object->getCategoryIds());
     return parent::afterLoad($object);
 }
 /**
  * In case the data was loaded, explode it into an array
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function afterLoad($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $data = $object->getData($attributeCode);
     // only explode and set the value if the attribute is set on the model
     if (null !== $data && is_string($data)) {
         $data = explode(',', $data);
         $object->setData($attributeCode, $data);
     }
     return parent::afterLoad($object);
 }
Example #10
0
 /**
  * Set inventory data to custom attribute
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function afterLoad($object)
 {
     $this->_inventory->loadByProduct($object);
     $object->setData($this->getAttribute()->getAttributeCode(), array('is_in_stock' => $this->_inventory->getIsInStock(), 'qty' => $this->_inventory->getQty()));
     return parent::afterLoad($object);
 }
 /**
  * Convert create date from UTC to current store time zone
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Time_Created
  */
 public function afterLoad($object)
 {
     $attributeCode = $this->getAttribute()->getAttributeCode();
     $date = $object->getData($attributeCode);
     // ADD THIS
     if (!is_null($date)) {
         $date = strtotime($date);
     }
     $zendDate = Mage::app()->getLocale()->storeDate(null, $date, true, $this->_getFormat($date));
     $object->setData($attributeCode, $zendDate->getIso());
     parent::afterLoad($object);
     return $this;
 }