Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Varien_Object
- <?php
- /**
- * Map of fields to sync to other fields upon changing their data
- */
- protected $_syncFieldsMap = array();
- /**
- * Constructor
- *
- * By default is looking for first argument as array and assignes it as object attributes
- * This behaviour may change in child classes
- *
- */
- public function __construct()
- {
- $this->_initOldFieldsMap();
- if ($this->_oldFieldsMap) {
- $this->_prepareSyncFieldsMap();
- }
- $args = func_get_args();
- if (empty($args[0])) {
- $args[0] = array();
- }
- $this->_data = $args[0];
- $this->_addFullNames();
- $this->_construct();
- }
- protected function _addFullNames()
- {
- $existedShortKeys = array_intersect($this->_syncFieldsMap, array_keys($this->_data));
- if (!empty($existedShortKeys)) {
- foreach ($existedShortKeys as $key) {
- $fullFieldName = array_search($key, $this->_syncFieldsMap);
- $this->_data[$fullFieldName] = $this->_data[$key];
- }
- }
- }
- ?>
- // Debug:
- Array
- (
- [0] => Array
- (
- [file] => /var/www/de_acdmshops_www/lib/Varien/Object.php
- [line] => 110
- [function] => _addFullNames
- [class] => Varien_Object
- [object] => Mage_Core_Model_Config_Options Object
- (
- [_dirExists:protected] => Array
- (
- )
- [_data:protected] => Array
- (
- )
- [_hasDataChanges:protected] =>
- [_origData:protected] =>
- [_idFieldName:protected] =>
- [_isDeleted:protected] =>
- [_oldFieldsMap:protected] => Array
- (
- )
- [_syncFieldsMap:protected] => Array
- (
- )
- )
- [type] => ->
- [args] => Array
- (
- )
- )
- [1] => Array
- (
- [file] => /var/www/de_acdmshops_www/app/code/core/Mage/Core/Model/Config.php
- [line] => 200
- [function] => __construct
- [class] => Varien_Object
- [object] => Mage_Core_Model_Config_Options Object
- (
- [_dirExists:protected] => Array
- (
- )
- [_data:protected] => Array
- (
- )
- [_hasDataChanges:protected] =>
- [_origData:protected] =>
- [_idFieldName:protected] =>
- [_isDeleted:protected] =>
- [_oldFieldsMap:protected] => Array
- (
- )
- [_syncFieldsMap:protected] => Array
- (
- )
- )
- [type] => ->
- [args] => Array
- (
- [0] => Array
- (
- )
- )
- )
- [2] => Array
- (
- [file] => /var/www/de_acdmshops_www/app/Mage.php
- [line] => 635
- [function] => __construct
- [class] => Mage_Core_Model_Config
- [object] => Mage_Core_Model_Config Object
- (
- [_useCache:protected] =>
- [_cacheSections:protected] => Array
- (
- [admin] => 0
- [adminhtml] => 0
- [crontab] => 0
- [install] => 0
- [stores] => 1
- [websites] => 0
- )
- [_cacheLoadedSections:protected] => Array
- (
- )
- [_options:protected] =>
- [_classNameCache:protected] => Array
- (
- )
- [_blockClassNameCache:protected] => Array
- (
- )
- [_secureUrlCache:protected] => Array
- (
- )
- [_distroServerVars:protected] =>
- [_substServerVars:protected] =>
- [_resourceModel:protected] =>
- [_eventAreas:protected] =>
- [_dirExists:protected] => Array
- (
- )
- [_allowCacheForInit:protected] => 1
- [_cachePartsForSave:protected] => Array
- (
- )
- [_prototype:protected] =>
- [_isLocalConfigLoaded:protected] =>
- [_baseDirCache:protected] => Array
- (
- )
- [_customEtcDir:protected] =>
- [_canUseLocalModules:protected] =>
- [_moduleNamespaces:Mage_Core_Model_Config:private] =>
- [_allowedModules:protected] => Array
- (
- )
- [_xml:protected] =>
- [_cacheId:protected] => config_global
- [_cacheTags:protected] => Array
- (
- )
- [_cacheLifetime:protected] =>
- [_cacheChecksum:protected] =>
- [_cacheSaved:protected] =>
- [_cache:protected] =>
- [_elementClass:protected] => Varien_Simplexml_Element
- [_xpathExtends:protected] => //*[@extends]
- )
- [type] => ->
- [args] => Array
- (
- [0] => Array
- (
- )
- )
- )
- [3] => Array
- (
- [file] => /var/www/de_acdmshops_www/index.php
- [line] => 80
- [function] => run
- [class] => Mage
- [type] => ::
- [args] => Array
- (
- [0] => s24d_de
- [1] => website
- )
- )
Add Comment
Please, Sign In to add comment