* @param $key Key to unset
* @return void
*/
- protected final function unsetGenericArrayElement ($keyGroup, $subGroup, $key) {
+ protected final function unsetGenericArrayKey ($keyGroup, $subGroup, $key) {
// Remove it
//* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' unset!' . PHP_EOL);
unset($this->genericArray[$keyGroup][$subGroup][$key]);
}
+ /**
+ * Unsets a given element in generic array
+ *
+ * @param $keyGroup Main group for the key
+ * @param $subGroup Sub group for the key
+ * @param $key Key to unset
+ * @param $element Element to unset
+ * @return void
+ */
+ protected final function unsetGenericArrayElement ($keyGroup, $subGroup, $key, $element) {
+ // Remove it
+ //* DEBUG: */ print(__METHOD__ . ': keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' unset!' . PHP_EOL);
+ unset($this->genericArray[$keyGroup][$subGroup][$key][$element]);
+ }
+
/**
* Append a string to a given generic array key
*
* @param $forceInit Optionally force initialization
* @return void
*/
- protected final function initGenericArray ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
+ protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
// Is it already set?
if (($forceInit === FALSE) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
// Already initialized
// Is it set?
if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
// Initialize array
- $this->initGenericArray($keyGroup, $subGroup, $key);
+ $this->initGenericArrayKey($keyGroup, $subGroup, $key);
} // END - if
// Then push it
protected function __construct ($className) {
// Call parent constructor
parent::__construct($className);
+
+ // Initialize all criteria arrays
+ foreach (array('default', 'choice', 'exclude') as $criteriaType) {
+ // Init it
+ $this->initGenericArrayKey('criteria', $criteriaType, 'entries');
+ } // END - foreach
}
/**
assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
// Determine it
- $isSet = $this->isGenericArrayKeySet('criteria', $criteriaType, $criteriaKey);
+ $isSet = $this->isGenericArrayElementSet('criteria', $criteriaType, 'entries', $criteriaKey);
// Return it
return $isSet;
* @return $criteria
*/
public final function getCriteriaArray ($criteriaType = 'default') {
- return $this->getGenericSubArray('criteria', $criteriaType);
+ return $this->getGenericArrayKey('criteria', $criteriaType, 'entries');
}
/**
// "Walk" through all criterias
foreach ($this->getGenericArray('criteria') as $criteriaType => $dummy) {
// Remove it
- $this->unsetGenericArrayElement('criteria', $criteriaType, $criteriaKey);
+ $this->unsetGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey);
} // END - foreach
}