Public Member Functions | |
_construct () | |
getProductsJSON () |
Definition at line 34 of file Serializer.php.
_construct | ( | ) |
Internal constructor, that is called from real constructor
Please override this one instead of overriding real __construct constructor
Please override this one instead of overriding real __construct constructor
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 36 of file Serializer.php.
00037 { 00038 parent::_construct(); 00039 $this->setTemplate('catalog/product/edit/serializer.phtml'); 00040 return $this; 00041 }
getProductsJSON | ( | ) |
Definition at line 43 of file Serializer.php.
00044 { 00045 $result = array(); 00046 if ($this->getProducts()) { 00047 $isEntityId = $this->getIsEntityId(); 00048 foreach ($this->getProducts() as $product) { 00049 $id = $isEntityId ? $product->getEntityId() : $product->getId(); 00050 $result[$id] = $product->toArray(array('qty', 'position')); 00051 } 00052 } 00053 return $result ? Zend_Json_Encoder::encode($result) : '{}'; 00054 }