Introduced isValidGenericArrayKey()
authorRoland Häder <roland@mxchange.org>
Sun, 23 Jun 2013 19:25:05 +0000 (19:25 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 23 Jun 2013 19:25:05 +0000 (19:25 +0000)
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/stacker/class_BaseStacker.php

index 09d13a5786c2faae223e49a2559654226ae28587..80d861d333f7c7eec27a7df3b9ef186ed4d6e8ea 100644 (file)
@@ -2119,38 +2119,38 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
-        * Determines if a key is set in the generic array
+        * Determines if an element is set in the generic array
         *
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to check
+        * @param       $element        Element to check
         * @return      $isset          Whether the given key is set
         */
-       protected final function isGenericArrayKeySet ($keyGroup, $subGroup, $key) {
+       protected final function isGenericArrayElementSet ($keyGroup, $subGroup, $key, $element) {
                // Is it there?
-               $isset = isset($this->genericArray[$keyGroup][$subGroup][$key]);
+               $isset = isset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
 
                // Return it
                return $isset;
        }
-
        /**
-        * Determines if an element is set in the generic array
+        * Determines if a key is set in the generic array
         *
         * @param       $keyGroup       Main group for the key
         * @param       $subGroup       Sub group for the key
         * @param       $key            Key to check
-        * @param       $element        Element to check
         * @return      $isset          Whether the given key is set
         */
-       protected final function isGenericArrayElementSet ($keyGroup, $subGroup, $key, $element) {
+       protected final function isGenericArrayKeySet ($keyGroup, $subGroup, $key) {
                // Is it there?
-               $isset = isset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
+               $isset = isset($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return it
                return $isset;
        }
 
+
        /**
         * Determines if a group is set in the generic array
         *
@@ -2478,6 +2478,22 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Return it
                return $isValid;
        }
+
+       /**
+        * Checks if a given key is valid (array)
+        *
+        * @param       $keyGroup       Key group to get
+        * @param       $subGroup       Sub group for the key
+        * @param       $key            Key to check
+        * @return      $isValid        Whether given sub group is valid
+        */
+       protected final function isValidGenericArrayKey ($keyGroup, $subGroup, $key) {
+               // Determine it
+               $isValid = (($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) && (is_array($this->getGenericArrayKey($keyGroup, $subGroup, $key))));
+
+               // Return it
+               return $isValid;
+       }
 }
 
 // [EOF]
index 7b4c18cd434189d774e79775a0b28ecf083b9359..d28175804e3d47e511a0db7886156ae4c92919df 100644 (file)
@@ -66,7 +66,7 @@ class BaseStacker extends BaseFrameworkSystem {
         */
        public final function isStackInitialized ($stackerName) {
                // Is is there?
-               $isInitialized = ($this->isValidGenericArrayGroup('stacks', $stackerName));
+               $isInitialized = ($this->isValidGenericArrayKey('stacks', $stackerName, 'entries'));
 
                // Return result
                return $isInitialized;