*/
function getCriteriaExcludeArray ();
+ /**
+ * Unsets a criteria key from all criteria types
+ *
+ * @param $criteriaKey Criteria key to unset
+ * @return void
+ */
+ function unsetCriteria ($criteriaKey);
+
/**
* Add criteria, this method converts dashes to underscores because dashes
* are not valid for criteria keys.
return $this->getCriteriaArray('exclude');
}
+ /**
+ * Unsets a criteria key from all criteria types
+ *
+ * @param $criteriaKey Criteria key to unset
+ * @return void
+ */
+ public final function unsetCriteria ($criteriaKey) {
+ // Make sure no 'my-' or 'my_' passes this point
+ assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
+
+ // Convert dashes to underscore
+ $criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
+
+ // "Walk" through all criterias
+ foreach ($this->criteria as $criteriaType => $dummy) {
+ // Remove it
+ unset($this->criteria[$criteriaType][$criteriaKey]);
+ } // END - foreach
+ }
+
/**
* Add criteria, this method converts dashes to underscores because dashes
* are not valid for criteria keys.
*/
private function getDataArrayFromFile ($fqfn) {
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Reading elements from database file ' . $fqfn . ' ...');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Reading elements from database file ' . $fqfn . ' ...');
// Init compressed data
$compressedData = $this->getFileIoInstance()->loadFileContents($fqfn);
$dataArray = unserialize($serializedData);
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.');
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE));
// Finally return it
return $dataArray;