Permalink
Browse files

Updating documentation for ClassRegistry::init() to not imply that it

can be used to construct non model objects.  Fixes #1633
  • Loading branch information...
1 parent 0d76724 commit a0321a723b77a3ffd1829131b9e4bbe55c9d194c @markstory markstory committed Apr 3, 2011
Showing with 7 additions and 6 deletions.
  1. +7 −6 cake/libs/class_registry.php
View
13 cake/libs/class_registry.php
@@ -71,27 +71,28 @@ function &getInstance() {
}
/**
- * Loads a class, registers the object in the registry and returns instance of the object.
+ * Loads a class, registers the object in the registry and returns instance of the object. ClassRegistry::init()
+ * is used as a factory for models, and handle correct injecting of settings, that assist in testing.
*
* Examples
* Simple Use: Get a Post model instance ```ClassRegistry::init('Post');```
*
- * Exapanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass');```
+ * Exapanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model');```
*
* Model Classes can accept optional ```array('id' => $id, 'table' => $table, 'ds' => $ds, 'alias' => $alias);```
*
* When $class is a numeric keyed array, multiple class instances will be stored in the registry,
* no instance of the object will be returned
* {{{
* array(
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass'),
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass'),
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass')
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model'),
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model'),
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model')
* );
* }}}
* @param mixed $class as a string or a single key => value array instance will be created,
* stored in the registry and returned.
- * @param string $type TypeOfClass
+ * @param string $type Only model is accepted as a valid value for $type.
* @return object instance of ClassName
* @access public
* @static

0 comments on commit a0321a7

Please sign in to comment.