X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fmain%2Fcriteria%2Fclass_BaseCriteria.php;h=1abb7afe9f531fc8089f085bbf79a4fd30b28434;hb=ddbfa7f3adf7db4bdc370d1f45c9f499d3bdb65c;hp=400ed06c4b7f46417a721930e5e43a03946782f4;hpb=9fc7596702ceb1dc9f8bfda402a98b0351159a23;p=core.git diff --git a/inc/classes/main/criteria/class_BaseCriteria.php b/inc/classes/main/criteria/class_BaseCriteria.php index 400ed06c..1abb7afe 100644 --- a/inc/classes/main/criteria/class_BaseCriteria.php +++ b/inc/classes/main/criteria/class_BaseCriteria.php @@ -161,6 +161,9 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @return void */ public final function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') { + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!'); + // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue))); @@ -168,7 +171,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey); // Append it $this->appendStringToGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue); @@ -228,6 +231,9 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { * @return $value Whether the value of the critera or FALSE */ public function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default') { + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!'); + // Make sure no 'my-' or 'my_' passes this point assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE)); @@ -235,7 +241,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { $criteriaKey = self::convertDashesToUnderscores($criteriaKey); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType)); // Default is not found $value = FALSE; @@ -246,6 +252,9 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria { $value = $this->getGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey); } // END - if + // Debug message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: value=' . $value . ' - EXIT!'); + // Return the value return $value; }