@@ -71,27 +71,28 @@ function &getInstance() {
71
71
}
72
72
73
73
/**
74
- * Loads a class, registers the object in the registry and returns instance of the object.
74
+ * Loads a class, registers the object in the registry and returns instance of the object. ClassRegistry::init()
75
+ * is used as a factory for models, and handle correct injecting of settings, that assist in testing.
75
76
*
76
77
* Examples
77
78
* Simple Use: Get a Post model instance ```ClassRegistry::init('Post');```
78
79
*
79
- * Exapanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass ');```
80
+ * Exapanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model ');```
80
81
*
81
82
* Model Classes can accept optional ```array('id' => $id, 'table' => $table, 'ds' => $ds, 'alias' => $alias);```
82
83
*
83
84
* When $class is a numeric keyed array, multiple class instances will be stored in the registry,
84
85
* no instance of the object will be returned
85
86
* {{{
86
87
* array(
87
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass '),
88
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass '),
89
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass ')
88
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model '),
89
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model '),
90
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model ')
90
91
* );
91
92
* }}}
92
93
* @param mixed $class as a string or a single key => value array instance will be created,
93
94
* stored in the registry and returned.
94
- * @param string $type TypeOfClass
95
+ * @param string $type Only model is accepted as a valid value for $type.
95
96
* @return object instance of ClassName
96
97
* @access public
97
98
* @static
0 commit comments