X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fmain%2Fclass_BaseFrameworkSystem.php;h=34b0a22e6a716924f51b6e622b18345175f1e499;hb=95673c6dbd12d46bed603a2724437ed863e3215b;hp=d146ed4b2202a64e491c1502a1ddfcf6caa00779;hpb=89f25725096fa51850e2d4d0a2ed57906c0b23e0;p=core.git diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index d146ed4b..34b0a22e 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -348,10 +348,13 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $this->setRealClass('DestructedObject'); } elseif ((defined('DEBUG_DESTRUCTOR')) && (is_object($this->getDebugInstance()))) { // Already destructed object - self::createDebugInstance(__CLASS__)->debugOutput(sprintf("[%s:] The object %s is already destroyed.", + self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[%s:] The object %s is already destroyed.', __CLASS__, $this->__toString() )); + } else { + // Do not call this twice + trigger_error(__METHOD__ . ': Called twice.'); } } @@ -423,7 +426,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Output stub message // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class - self::createDebugInstance(__CLASS__)->debugOutput(sprintf("[unknown::%s:] Stub! Args: %s", + self::createDebugInstance(__CLASS__)->debugOutput(sprintf('[unknown::%s:] Stub! Args: %s', $methodName, $argsString )); @@ -449,7 +452,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function __set ($name, $value) { - $this->debugBackTrace(sprintf("Tried to set a missing field. name=%s, value[%s]=%s", + $this->debugBackTrace(sprintf('Tried to set a missing field. name=%s, value[%s]=%s', $name, gettype($value), $value @@ -463,7 +466,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function __get ($name) { - $this->debugBackTrace(sprintf("Tried to get a missing field. name=%s", + $this->debugBackTrace(sprintf('Tried to get a missing field. name=%s', $name )); } @@ -475,7 +478,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return void */ public final function __unset ($name) { - $this->debugBackTrace(sprintf("Tried to unset a missing field. name=%s", + $this->debugBackTrace(sprintf('Tried to unset a missing field. name=%s', $name )); } @@ -1334,11 +1337,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Is a message set? if (!empty($message)) { // Construct message - $content = sprintf("
Message: %s
\n", $message); + $content = sprintf('
Message: %s
' . PHP_EOL, $message); } // END - if // Generate the output - $content .= sprintf("
%s
", + $content .= sprintf('
%s
', trim( htmlentities( print_r($this, true) @@ -1347,7 +1350,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { ); // Output it - ApplicationEntryPoint::app_exit(sprintf("
%s debug output:
%s
\nLoaded includes:
%s
", + ApplicationEntryPoint::app_exit(sprintf('
%s debug output:
%s
Loaded includes:
%s
', $this->__toString(), $content, ClassLoader::getSelfInstance()->getPrintableIncludeList() @@ -1460,6 +1463,17 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $debugInstance; } + /** + * Simple output of a message with line-break + * + * @param $message Message to output + * @return void + */ + public function outputLine ($message) { + // Simply output it + print($message . PHP_EOL); + } + /** * Outputs a debug message whether to debug instance (should be set!) or * dies with or ptints the message. Do NEVER EVER rewrite the exit() call to @@ -1501,7 +1515,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Put directly out if ($doPrint === TRUE) { // Print message - print($message . chr(10)); + $this->outputLine($message); } else { // Die here exit($message); @@ -2116,38 +2130,44 @@ 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) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $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) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $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 * @@ -2156,6 +2176,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $isset Whether the given group is set */ protected final function isGenericArrayGroupSet ($keyGroup, $subGroup) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup); + // Is it there? $isset = isset($this->genericArray[$keyGroup][$subGroup]); @@ -2177,6 +2200,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' not found.'); } // END - if + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], TRUE)); + // Return it return $this->genericArray[$keyGroup][$subGroup]; } @@ -2189,11 +2215,31 @@ 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) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); + // Remove it 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) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element); + + // Remove it + unset($this->genericArray[$keyGroup][$subGroup][$key][$element]); + } + /** * Append a string to a given generic array key * @@ -2203,7 +2249,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @param $value Value to add/append * @return void */ - protected final function appendStringToGenericArrayElement ($keyGroup, $subGroup, $key, $value, $appendGlue = '') { + protected final function appendStringToGenericArrayKey ($keyGroup, $subGroup, $key, $value, $appendGlue = '') { + // Debug message + //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . ',appendGlue=' . $appendGlue); + // Is it already there? if ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Append it @@ -2214,6 +2263,100 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } } + /** + * Append a string to a given generic array element + * + * @param $keyGroup Main group for the key + * @param $subGroup Sub group for the key + * @param $key Key to unset + * @param $element Element to check + * @param $value Value to add/append + * @return void + */ + protected final function appendStringToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value, $appendGlue = '') { + // Debug message + //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . ',appendGlue=' . $appendGlue); + + // Is it already there? + if ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) { + // Append it + $this->genericArray[$keyGroup][$subGroup][$key][$element] .= $appendGlue . (string) $value; + } else { + // Add it + $this->genericArray[$keyGroup][$subGroup][$key][$element] = (string) $value; + } + } + + /** + * Initializes given generic array group + * + * @param $keyGroup Main group for the key + * @param $subGroup Sub group for the key + * @param $key Key to use + * @param $forceInit Optionally force initialization + * @return void + */ + protected final function initGenericArrayGroup ($keyGroup, $subGroup, $forceInit = FALSE) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',forceInit=' . intval($forceInit)); + + // Is it already set? + if (($forceInit === FALSE) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) { + // Already initialized + trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' already initialized.'); + } // END - if + + // Initialize it + $this->genericArray[$keyGroup][$subGroup] = array(); + } + + /** + * Initializes given generic array key + * + * @param $keyGroup Main group for the key + * @param $subGroup Sub group for the key + * @param $key Key to use + * @param $forceInit Optionally force initialization + * @return void + */ + protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = FALSE) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',forceInit=' . intval($forceInit)); + + // Is it already set? + if (($forceInit === FALSE) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) { + // Already initialized + trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' already initialized.'); + } // END - if + + // Initialize it + $this->genericArray[$keyGroup][$subGroup][$key] = array(); + } + + /** + * Initializes given generic array element + * + * @param $keyGroup Main group for the key + * @param $subGroup Sub group for the key + * @param $key Key to use + * @param $element Element to use + * @param $forceInit Optionally force initialization + * @return void + */ + protected final function initGenericArrayElement ($keyGroup, $subGroup, $key, $element, $forceInit = FALSE) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',forceInit=' . intval($forceInit)); + + // Is it already set? + if (($forceInit === FALSE) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) { + // Already initialized + trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ' already initialized.'); + } // END - if + + // Initialize it + $this->genericArray[$keyGroup][$subGroup][$key][$element] = array(); + } + /** * Pushes an element to a generic key * @@ -2223,33 +2366,52 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @param $value Value to add/append * @return $count Number of array elements */ - protected final function pushValueToGenericArrayElement ($keyGroup, $subGroup, $key, $value) { + protected final function pushValueToGenericArrayKey ($keyGroup, $subGroup, $key, $value) { + // Debug message + //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + // Is it set? if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Initialize array - $this->genericArray[$keyGroup][$subGroup][$key] = array(); + $this->initGenericArrayKey($keyGroup, $subGroup, $key); } // END - if // Then push it $count = array_push($this->genericArray[$keyGroup][$subGroup][$key], $value); // Return count + //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE)); + //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL); return $count; } /** - * Sets a value in given generic array key/element + * Pushes an element to a generic array element * * @param $keyGroup Main group for the key * @param $subGroup Sub group for the key - * @param $key Key to set - * @param $element Element to set - * @param $value Value to set - * @return void + * @param $key Key to use + * @param $element Element to check + * @param $value Value to add/append + * @return $count Number of array elements */ - protected final function setGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) { - // Then set it - $this->genericArray[$keyGroup][$subGroup][$key][$element] = $value; + protected final function pushValueToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) { + // Debug message + //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + + // Is it set? + if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) { + // Initialize array + $this->initGenericArrayElement($keyGroup, $subGroup, $key, $element); + } // END - if + + // Then push it + $count = array_push($this->genericArray[$keyGroup][$subGroup][$key][$element], $value); + + // Return count + //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE)); + //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL); + return $count; } /** @@ -2261,6 +2423,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $value Last "popped" value */ protected final function popGenericArrayElement ($keyGroup, $subGroup, $key) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); + // Is it set? if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Not found @@ -2271,6 +2436,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $value = array_pop($this->genericArray[$keyGroup][$subGroup][$key]); // Return value + //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE)); + //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, TRUE) . PHP_EOL); return $value; } @@ -2283,6 +2450,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $value Last "popped" value */ protected final function shiftGenericArrayElement ($keyGroup, $subGroup, $key) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); + // Is it set? if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Not found @@ -2293,6 +2463,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $value = array_shift($this->genericArray[$keyGroup][$subGroup][$key]); // Return value + //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE)); + //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, TRUE) . PHP_EOL); return $value; } @@ -2303,6 +2475,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $count Count of given group */ protected final function countGenericArray ($keyGroup) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup); + // Is it there? if (!isset($this->genericArray[$keyGroup])) { // Abort here @@ -2312,6 +2487,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Then count it $count = count($this->genericArray[$keyGroup]); + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',count=' . $count); + // Return it return $count; } @@ -2324,6 +2502,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $count Count of given group */ protected final function countGenericArrayGroup ($keyGroup, $subGroup) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup); + // Is it there? if (!$this->isGenericArrayGroupSet($keyGroup, $subGroup)) { // Abort here @@ -2333,6 +2514,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Then count it $count = count($this->genericArray[$keyGroup][$subGroup]); + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',count=' . $count); + // Return it return $count; } @@ -2346,8 +2530,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $count Count of given key */ protected final function countGenericArrayElements ($keyGroup, $subGroup, $key) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); + // Is it there? - if (!$this->isGenericArrayKeySet($keyGroup, $subGroup)) { + if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Abort here trigger_error(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' not found.'); } elseif (!$this->isValidGenericArrayGroup($keyGroup, $subGroup)) { @@ -2358,6 +2545,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Then count it $count = count($this->genericArray[$keyGroup][$subGroup][$key]); + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',count=' . $count); + // Return it return $count; } @@ -2369,6 +2559,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $array Whole generic array group */ protected final function getGenericArray ($keyGroup) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup); + // Is it there? if (!isset($this->genericArray[$keyGroup])) { // Then abort here @@ -2379,6 +2572,23 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->genericArray[$keyGroup]; } + /** + * Setter for generic array key + * + * @param $keyGroup Key group to get + * @param $subGroup Sub group for the key + * @param $key Key to unset + * @param $value Mixed value from generic array element + * @return void + */ + protected final function setGenericArrayKey ($keyGroup, $subGroup, $key, $value) { + // Debug message + //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + + // Set value here + $this->genericArray[$keyGroup][$subGroup][$key] = $value; + } + /** * Getter for generic array key * @@ -2388,6 +2598,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $value Mixed value from generic array element */ protected final function getGenericArrayKey ($keyGroup, $subGroup, $key) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); + // Is it there? if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) { // Then abort here @@ -2398,6 +2611,24 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { return $this->genericArray[$keyGroup][$subGroup][$key]; } + /** + * Sets a value in given generic array key/element + * + * @param $keyGroup Main group for the key + * @param $subGroup Sub group for the key + * @param $key Key to set + * @param $element Element to set + * @param $value Value to set + * @return void + */ + protected final function setGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) { + // Debug message + //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE)); + + // Then set it + $this->genericArray[$keyGroup][$subGroup][$key][$element] = $value; + } + /** * Getter for generic array element * @@ -2408,6 +2639,9 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $value Mixed value from generic array element */ protected final function getGenericArrayElement ($keyGroup, $subGroup, $key, $element) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element); + // Is it there? if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) { // Then abort here @@ -2426,12 +2660,34 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return $isValid Whether given sub group is valid */ protected final function isValidGenericArrayGroup ($keyGroup, $subGroup) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup); + // Determine it $isValid = (($this->isGenericArrayGroupSet($keyGroup, $subGroup)) && (is_array($this->getGenericSubArray($keyGroup, $subGroup)))); // 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) { + // Debug message + //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key); + + // Determine it + $isValid = (($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) && (is_array($this->getGenericArrayKey($keyGroup, $subGroup, $key)))); + + // Return it + return $isValid; + } } // [EOF]