mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Updating documentation for ClassRegistry::init() to not imply that it
can be used to construct non model objects. Fixes #1633
This commit is contained in:
parent
0d7672476f
commit
a0321a723b
1 changed files with 7 additions and 6 deletions
|
@ -71,12 +71,13 @@ class ClassRegistry {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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);```
|
||||
*
|
||||
|
@ -84,14 +85,14 @@ class ClassRegistry {
|
|||
* 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
|
||||
|
|
Loading…
Reference in a new issue