Guest User

Untitled

a guest
Jul 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.75 KB | None | 0 0
  1. // Varien_Object
  2. <?php
  3. /**
  4. * Map of fields to sync to other fields upon changing their data
  5. */
  6. protected $_syncFieldsMap = array();
  7.  
  8. /**
  9. * Constructor
  10. *
  11. * By default is looking for first argument as array and assignes it as object attributes
  12. * This behaviour may change in child classes
  13. *
  14. */
  15. public function __construct()
  16. {
  17. $this->_initOldFieldsMap();
  18. if ($this->_oldFieldsMap) {
  19. $this->_prepareSyncFieldsMap();
  20. }
  21.  
  22. $args = func_get_args();
  23. if (empty($args[0])) {
  24. $args[0] = array();
  25. }
  26. $this->_data = $args[0];
  27. $this->_addFullNames();
  28.  
  29. $this->_construct();
  30. }
  31.  
  32. protected function _addFullNames()
  33. {
  34. $existedShortKeys = array_intersect($this->_syncFieldsMap, array_keys($this->_data));
  35. if (!empty($existedShortKeys)) {
  36. foreach ($existedShortKeys as $key) {
  37. $fullFieldName = array_search($key, $this->_syncFieldsMap);
  38. $this->_data[$fullFieldName] = $this->_data[$key];
  39. }
  40. }
  41. }
  42. ?>
  43.  
  44. // Debug:
  45. Array
  46. (
  47. [0] => Array
  48. (
  49. [file] => /var/www/de_acdmshops_www/lib/Varien/Object.php
  50. [line] => 110
  51. [function] => _addFullNames
  52. [class] => Varien_Object
  53. [object] => Mage_Core_Model_Config_Options Object
  54. (
  55. [_dirExists:protected] => Array
  56. (
  57. )
  58.  
  59. [_data:protected] => Array
  60. (
  61. )
  62.  
  63. [_hasDataChanges:protected] =>
  64. [_origData:protected] =>
  65. [_idFieldName:protected] =>
  66. [_isDeleted:protected] =>
  67. [_oldFieldsMap:protected] => Array
  68. (
  69. )
  70.  
  71. [_syncFieldsMap:protected] => Array
  72. (
  73. )
  74.  
  75. )
  76.  
  77. [type] => ->
  78. [args] => Array
  79. (
  80. )
  81.  
  82. )
  83.  
  84. [1] => Array
  85. (
  86. [file] => /var/www/de_acdmshops_www/app/code/core/Mage/Core/Model/Config.php
  87. [line] => 200
  88. [function] => __construct
  89. [class] => Varien_Object
  90. [object] => Mage_Core_Model_Config_Options Object
  91. (
  92. [_dirExists:protected] => Array
  93. (
  94. )
  95.  
  96. [_data:protected] => Array
  97. (
  98. )
  99.  
  100. [_hasDataChanges:protected] =>
  101. [_origData:protected] =>
  102. [_idFieldName:protected] =>
  103. [_isDeleted:protected] =>
  104. [_oldFieldsMap:protected] => Array
  105. (
  106. )
  107.  
  108. [_syncFieldsMap:protected] => Array
  109. (
  110. )
  111.  
  112. )
  113.  
  114. [type] => ->
  115. [args] => Array
  116. (
  117. [0] => Array
  118. (
  119. )
  120.  
  121. )
  122.  
  123. )
  124.  
  125. [2] => Array
  126. (
  127. [file] => /var/www/de_acdmshops_www/app/Mage.php
  128. [line] => 635
  129. [function] => __construct
  130. [class] => Mage_Core_Model_Config
  131. [object] => Mage_Core_Model_Config Object
  132. (
  133. [_useCache:protected] =>
  134. [_cacheSections:protected] => Array
  135. (
  136. [admin] => 0
  137. [adminhtml] => 0
  138. [crontab] => 0
  139. [install] => 0
  140. [stores] => 1
  141. [websites] => 0
  142. )
  143.  
  144. [_cacheLoadedSections:protected] => Array
  145. (
  146. )
  147.  
  148. [_options:protected] =>
  149. [_classNameCache:protected] => Array
  150. (
  151. )
  152.  
  153. [_blockClassNameCache:protected] => Array
  154. (
  155. )
  156.  
  157. [_secureUrlCache:protected] => Array
  158. (
  159. )
  160.  
  161. [_distroServerVars:protected] =>
  162. [_substServerVars:protected] =>
  163. [_resourceModel:protected] =>
  164. [_eventAreas:protected] =>
  165. [_dirExists:protected] => Array
  166. (
  167. )
  168.  
  169. [_allowCacheForInit:protected] => 1
  170. [_cachePartsForSave:protected] => Array
  171. (
  172. )
  173.  
  174. [_prototype:protected] =>
  175. [_isLocalConfigLoaded:protected] =>
  176. [_baseDirCache:protected] => Array
  177. (
  178. )
  179.  
  180. [_customEtcDir:protected] =>
  181. [_canUseLocalModules:protected] =>
  182. [_moduleNamespaces:Mage_Core_Model_Config:private] =>
  183. [_allowedModules:protected] => Array
  184. (
  185. )
  186.  
  187. [_xml:protected] =>
  188. [_cacheId:protected] => config_global
  189. [_cacheTags:protected] => Array
  190. (
  191. )
  192.  
  193. [_cacheLifetime:protected] =>
  194. [_cacheChecksum:protected] =>
  195. [_cacheSaved:protected] =>
  196. [_cache:protected] =>
  197. [_elementClass:protected] => Varien_Simplexml_Element
  198. [_xpathExtends:protected] => //*[@extends]
  199. )
  200.  
  201. [type] => ->
  202. [args] => Array
  203. (
  204. [0] => Array
  205. (
  206. )
  207.  
  208. )
  209.  
  210. )
  211.  
  212. [3] => Array
  213. (
  214. [file] => /var/www/de_acdmshops_www/index.php
  215. [line] => 80
  216. [function] => run
  217. [class] => Mage
  218. [type] => ::
  219. [args] => Array
  220. (
  221. [0] => s24d_de
  222. [1] => website
  223. )
  224.  
  225. )
Add Comment
Please, Sign In to add comment