]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/class_BaseFrameworkSystem.php
Fixed more generic array handling, introduced unsetGenericArrayKey()
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index 0fb474dcb865fafa32ceb60749b6428817b2439b..62b79bda0d49440bd0827c1d076fd0ff5a8312e3 100644 (file)
@@ -2193,12 +2193,27 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $key            Key to unset
         * @return      void
         */
-       protected final function unsetGenericArrayElement ($keyGroup, $subGroup, $key) {
+       protected final function unsetGenericArrayKey ($keyGroup, $subGroup, $key) {
                // Remove it
                //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' unset!' . PHP_EOL);
                unset($this->genericArray[$keyGroup][$subGroup][$key]);
        }
 
+       /**
+        * Unsets a given element in generic array
+        *
+        * @param       $keyGroup       Main group for the key
+        * @param       $subGroup       Sub group for the key
+        * @param       $key            Key to unset
+        * @param       $element        Element to unset
+        * @return      void
+        */
+       protected final function unsetGenericArrayElement ($keyGroup, $subGroup, $key, $element) {
+               // Remove it
+               //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' unset!' . PHP_EOL);
+               unset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
+       }
+
        /**
         * Append a string to a given generic array key
         *
@@ -2228,7 +2243,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
-       protected final function initGenericArray ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
+       protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
                // Is it already set?
                if (($forceInit === FALSE) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
                        // Already initialized
@@ -2253,7 +2268,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
                        // Initialize array
-                       $this->initGenericArray($keyGroup, $subGroup, $key);
+                       $this->initGenericArrayKey($keyGroup, $subGroup, $key);
                } // END - if
 
                // Then push it