本文整理汇总了PHP中Mage_Core_Model_Config_Base::setNode方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Config_Base::setNode方法的具体用法?PHP Mage_Core_Model_Config_Base::setNode怎么用?PHP Mage_Core_Model_Config_Base::setNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Config_Base
的用法示例。
在下文中一共展示了Mage_Core_Model_Config_Base::setNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setNode
/**
* Create node by $path and set its value.
*
* @param string $path separated by slashes
* @param string $value
* @param bool $overwrite
* @return Varien_Simplexml_Config
*/
public function setNode($path, $value, $overwrite = true)
{
if ($this->_useCache && $path !== null) {
$sectionPath = explode('/', $path);
$config = $this->_getSectionConfig($sectionPath);
if ($config) {
$sectionPath = array_slice($sectionPath, $this->_cacheSections[$sectionPath[0]] + 1);
$sectionPath = implode('/', $sectionPath);
$config->setNode($sectionPath, $value, $overwrite);
}
}
return parent::setNode($path, $value, $overwrite);
}
示例2: _mockConfig
/**
* Mock config
*/
protected function _mockConfig()
{
$configObject = new Mage_Core_Model_Config_Base(new Varien_Simplexml_Element('<config></config>'));
$configObject->setNode('global/importexport/import_entities/' . $this->_testEntity['node'] . '/model_token', 'Some_Class');
$configObject->setNode('global/importexport/import_entities/' . $this->_testEntity['node'] . '/label', $this->_testEntity['label']);
$config = new ReflectionProperty('Mage', '_config');
$config->setAccessible(true);
$config->setValue(null, $configObject);
}