parent::__construct($className);
// Init generic arrays
- $this->initGenericArrayGroup('raw', 'generic');
- $this->initGenericArrayGroup('raw', 'instance');
+ $this->initGenericArrayGroup('registry', 'generic');
+ $this->initGenericArrayGroup('registry', 'instance');
}
/**
* @return $iteratorInstance An instance of a Iterator class
*/
public function getIterator () {
- // Instance + return it
- return ObjectFactory::createObjectByConfiguredName('registry_iterator_class', array($this));
+ // Is it set?
+ if (is_null($this->getIteratorInstance())) {
+ // Then instance it
+ $iteratorInstance = ObjectFactory::createObjectByConfiguredName('registry_iterator_class', array($this));
+
+ // ... and set it here
+ $this->setIteratorInstance($iteratorInstance);
+ } else {
+ // Use set iterator
+ $iteratorInstance = $this->getIteratorInstance();
+ }
+
+ // Return it
+ return $iteratorInstance;
}
/**
$this->setGenericArrayKey('registry', 'instance', $instanceKey, $objectInstance);
}
+ /**
+ * Getter for whole generic registry
+ *
+ * @return $instanceRegistry The whole generic registry array
+ */
+ public final function getGenericRegistry () {
+ return $this->getGenericSubArray('registry', 'generic');
+ }
+
/**
* Getter for whole instance registry
*
assert(!is_array($key));
// Push it
- $this->pushValueToGenericArrayKey('raw', 'generic', $key, $value);
+ $this->pushValueToGenericArrayKey('registry', 'generic', $key, $value);
}
/**
assert(!is_array($key));
// Default is whole array
- $entries = $this->getGenericArray('raw');
+ $entries = $this->getGenericArray('registry');
// Is $key set?
if (!is_null($key)) {
// Then use this entry
- $entries = $this->getGenericArrayKey('raw', 'generic', $key);
+ $entries = $this->getGenericArrayKey('registry', 'generic', $key);
} // END - if
// Return the array