parent::__construct($className);
}
+ /**
+ * Checks whether given key is set
+ *
+ * @param $criteriaType Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
+ * @param $criteriaKey Criteria key
+ * @return $isSet Whether key is set
+ */
+ public function isKeySet ($criteriaType, $criteriaKey) {
+ // Determine it
+ $isSet = isset($this->criteria[$criteriaType][$criteriaKey]);
+
+ // Return it
+ return $isSet;
+ }
+
+ /**
+ * Checks whether given key is set for 'choice' type
+ *
+ * @param $criteriaKey Criteria key
+ * @return $isSet Whether key is set
+ */
+ public function isChoiceKeySet ($criteriaKey) {
+ // Call inner method
+ return $this->isKeySet('choice', $criteriaKey);
+ }
+
+ /**
+ * Checks whether given key is set for 'exclude' type
+ *
+ * @param $criteriaKey Criteria key
+ * @return $isSet Whether key is set
+ */
+ public function isExcludeKeySet ($criteriaKey) {
+ // Call inner method
+ return $this->isKeySet('exclude', $criteriaKey);
+ }
+
/**
* Setter for wrapper class name
*
$criteriaKey = $this->convertDashesToUnderscores($criteriaKey);
// Is it already there?
- if (isset($this->criteria[$criteriaType][$criteriaKey])) {
+ if ($this->isKeySet($criteriaType, $criteriaKey)) {
// Append it
$this->criteria[$criteriaType][$criteriaKey] .= ',' . $criteriaValue;
} else {
$value = NULL;
// Is the criteria there?
- if (isset($this->criteria[$criteriaType][$criteriaKey])) {
+ if ($this->isKeySet($criteriaType, $criteriaKey)) {
// Then use it
$value = $this->criteria[$criteriaType][$criteriaKey];
} // END - if