Introduced initStackers() which wraps initialization of several stacks
[core.git] / inc / classes / main / stacker / class_BaseStacker.php
index aaa1adcae20770e9d667c16eb5e757a8a08bd87f..e329f60059a311da7eb1f31b00f7e0f46fe27681 100644 (file)
@@ -55,7 +55,20 @@ class BaseStacker extends BaseFrameworkSystem {
                } // END - if
 
                // Initialize the given stack
-               $this->initGenericArray('stacks', $stackerName, 'entries', $forceReInit);
+               $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);
        }
 
        /**