/** * 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(); }
/** * 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; }
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()); }
/** * @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; }