Introduced initStackers() which wraps initialization of several stacks
[core.git] / inc / classes / main / stacker / class_BaseStacker.php
index d5917bb564079861f675b0ebb7e1687c4bff451d..e329f60059a311da7eb1f31b00f7e0f46fe27681 100644 (file)
@@ -55,7 +55,20 @@ class BaseStacker extends BaseFrameworkSystem {
                } // END - if
 
                // Initialize the given stack
-               $this->initGenericArray('stacks', $stackerName, 'entries');
+               $this->initGenericArrayKey('stacks', $stackerName, 'entries', $forceReInit);
+       }
+
+       /**
+        * Initializes all stackers
+        *
+        * @return      void
+        */
+       public function initStackers (array $stacks) {
+               // "Walk" through all (more will be added as needed
+               foreach ($stacks as $stackerName) {
+                       // Init this stack
+                       $this->initStacker($stackerName);
+               } // END - foreach
        }
 
        /**
@@ -154,7 +167,7 @@ class BaseStacker extends BaseFrameworkSystem {
                }
 
                // Now add the value to the stack
-               $this->pushValueToGenericArrayElement('stacks', $stackerName, 'entries', $value);
+               $this->pushValueToGenericArrayKey('stacks', $stackerName, 'entries', $value);
        }
 
        /**