namespace CoreFramework\Registry;
// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
use CoreFramework\Generic\NullPointerException;
use CoreFramework\Object\BaseFrameworkSystem;
+// Import SPL stuff
+use \IteratorAggregate;
+
/**
* A general Registry
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class BaseRegistry extends BaseFrameworkSystem implements Registerable {
+class BaseRegistry extends BaseFrameworkSystem implements Register, Registerable, IteratorAggregate {
/**
* Glue for generating a registry key
*/
// Call parent constructor
parent::__construct($className);
- // Init raw array
+ // Init generic arrays
$this->initGenericArrayGroup('raw', 'generic');
+ $this->initGenericArrayGroup('raw', 'instance');
+ }
+
+ /**
+ * Returns an iterator for this whole registry.
+ *
+ * @return $iteratorInstance An instance of a Iterator class
+ */
+ public function getIterator () {
+ // Instance + return it
+ return ObjectFactory::createObjectByConfiguredName('registry_iterator_class', array($this));
}
/**
} // END - foreach
// Debug message
- //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Returning entry(' . count($entry) . ')=' . print_r($entry, TRUE));
+ //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Returning entry(' . count($entry) . ')=' . print_r($entry, true));
// Return it
return $entry;