$this->appendStringToGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
}
+ /**
+ * Set criteria, this method converts dashes to underscores because dashes
+ * are not valid for criteria keys.
+ *
+ * @param $criteriaKey Criteria key
+ * @param $criteriaValue Criteria value
+ * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
+ * @return void
+ */
+ public final function setCriteria ($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)));
+
+ // Convert dashes to underscore
+ $criteriaKey = self::convertDashesToUnderscores($criteriaKey);
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey);
+
+ // Set it
+ $this->setStringGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
+ }
+
/**
* Add "choice" criteria, this method converts dashes to underscores because
* dashes are not valid for criteria keys.