Esempio n. 1
0
 /**
  * Cleanup circular references between layout & blocks
  *
  * Destructor should be called explicitly in order to work around the PHP bug
  * https://bugs.php.net/bug.php?id=62468
  */
 public function __destruct()
 {
     if (isset($this->_update) && is_object($this->_update)) {
         $this->_update->__destruct();
         $this->_update = null;
     }
     $this->_blocks = [];
     parent::__destruct();
 }
Esempio n. 2
0
 /**
  * Enter description here...
  *
  * @param \Magento\Framework\Simplexml\Config $config
  * @param boolean $overwrite
  * @return $this
  */
 public function extend(\Magento\Framework\Simplexml\Config $config, $overwrite = true)
 {
     $this->getNode()->extend($config->getNode(), $overwrite);
     return $this;
 }
Esempio n. 3
0
 public function testExtendNode()
 {
     $config = new Config(__DIR__ . '/_files/data.xml');
     $config->extend(new Config('<config><node>1</node></config>'));
     $this->assertSame('1', $config->getNode('node')->asArray());
 }
Esempio n. 4
0
 /**
  * @param string|\Magento\Framework\Simplexml\Element $sourceData $sourceData
  */
 public function __construct($sourceData = null)
 {
     $this->_elementClass = 'Magento\\Framework\\App\\Config\\Element';
     parent::__construct($sourceData);
     self::$instances[] = $this;
 }