]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/criteria/class_BaseCriteria.php
Fixed searched criteria handling #3
[core.git] / inc / classes / main / criteria / class_BaseCriteria.php
index ab91f93c9ba9e6805345982307cffe9ae40c7496..b0edb27dc270a17c2be4bb7cf46b110a04a9dc5f 100644 (file)
@@ -148,7 +148,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        public final function addCriteria ($criteriaKey, $criteriaValue, $criteriaType = 'default') {
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
+               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
 
                // Convert dashes to underscore
                $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
@@ -176,7 +176,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        public final function addChoiceCriteria ($criteriaKey, $criteriaValue) {
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
+               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
@@ -213,11 +213,11 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
        }
 
        /**
-        * Get criteria element or null if not found
+        * Get criteria element or FALSE if not found
         *
         * @param       $criteriaKey    The requested criteria key
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
-        * @return      $value                  Whether the value of the critera or null
+        * @return      $value                  Whether the value of the critera or FALSE
         */
        public function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default') {
                // Make sure no 'my-' or 'my_' passes this point
@@ -230,7 +230,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteria()=' . count($this->criteria[$criteriaType]));
 
                // Default is not found
-               $value = NULL;
+               $value = FALSE;
 
                // Is the criteria there?
                if ($this->isKeySet($criteriaType, $criteriaKey)) {
@@ -243,10 +243,10 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
        }
 
        /**
-        * Get criteria element or null if not found for 'choice' type
+        * Get criteria element or FALSE if not found for 'choice' type
         *
         * @param       $criteriaKey    The requested criteria key
-        * @return      $value                  Whether the value of the critera or null
+        * @return      $value                  Whether the value of the critera or FALSE
         */
        public function getCriteriaChoiceElemnent ($criteriaKey) {
                // Call inner method
@@ -254,10 +254,10 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
        }
 
        /**
-        * Get criteria element or null if not found for 'exclude' type
+        * Get criteria element or FALSE if not found for 'exclude' type
         *
         * @param       $criteriaKey    The requested criteria key
-        * @return      $value                  Whether the value of the critera or null
+        * @return      $value                  Whether the value of the critera or FALSE
         */
        public function getCriteriaExcludeElemnent ($criteriaKey) {
                // Call inner method
@@ -287,7 +287,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                        // Then walk through all search criteria
                        foreach ($this->criteria[$criteriaType] as $criteriaKey => $criteriaValue) {
                                // Make sure no 'my-' or 'my_' passes this point
-                               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
+                               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
 
                                // Convert dashes to underscore
                                $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
@@ -349,7 +349,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                // Now walk through all criterias
                foreach ($this->criteria[$criteriaType] as $criteriaKey => $criteriaValue) {
                        // Make sure no 'my-' or 'my_' passes this point
-                       assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
+                       assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
 
                        // Convert dashes to underscore
                        $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);