Ejemplo n.º 1
0
 public function testSetGetSerializable()
 {
     $this->assertClassHasStaticAttribute('_isSerializable', 'Mage');
     Mage::setIsSerializable(false);
     $this->assertFalse(Mage::getIsSerializable());
     Mage::setIsSerializable(true);
     $this->assertTrue(Mage::getIsSerializable());
     // incorrect data
     Mage::setIsSerializable('random_string');
     $this->assertTrue(Mage::getIsSerializable());
 }
Ejemplo n.º 2
0
 public function __wakeup()
 {
     if (Mage::getIsSerializable()) {
         $this->_moduleHelper = Mage::helper($this->_moduleHelperName);
         $this->_validator = Mage::getSingleton('Mage_Backend_Model_Menu_Item_Validator');
         $this->_acl = Mage::getSingleton('Mage_Core_Model_Authorization');
         $this->_appConfig = Mage::getConfig();
         $this->_storeConfig = Mage::getSingleton('Mage_Core_Model_Store_Config');
         $this->_menuFactory = Mage::getSingleton('Mage_Backend_Model_Menu_Factory');
         $this->_urlModel = Mage::getSingleton('Mage_Backend_Model_Url');
         if ($this->_serializedSubmenu) {
             $this->_submenu = $this->_menuFactory->getMenuInstance();
             $this->_submenu->unserialize($this->_serializedSubmenu);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Init not serializable fields
  */
 public function __wakeup()
 {
     if (Mage::getIsSerializable()) {
         $this->_eventDispatcher = Mage::getObjectManager()->get('Mage_Core_Model_Event_Manager');
         $this->_cacheManager = Mage::getObjectManager()->get('Mage_Core_Model_Cache');
     }
 }