Updating doc blocks for bindModel and unbindModel, explaining that associations are only reset when find() is called. Refs #652

This commit is contained in:
Mark Story 2010-05-01 17:37:23 -04:00
parent ad51115e12
commit 257665eb5b

View file

@ -510,14 +510,16 @@ class Model extends Overloadable {
/** /**
* Bind model associations on the fly. * Bind model associations on the fly.
* *
* If $reset is false, association will not be reset * If `$reset` is false, association will not be reset
* to the originals defined in the model * to the originals defined in the model
* *
* Example: Add a new hasOne binding to the Profile model not * Example: Add a new hasOne binding to the Profile model not
* defined in the model source code: * defined in the model source code:
* <code> *
* $this->User->bindModel( array('hasOne' => array('Profile')) ); * `$this->User->bindModel( array('hasOne' => array('Profile')) );`
* </code> *
* Bindings that are not made permanent will be reset by the next Model::find() call on this
* model.
* *
* @param array $params Set of bindings (indexed by binding type) * @param array $params Set of bindings (indexed by binding type)
* @param boolean $reset Set to false to make the binding permanent * @param boolean $reset Set to false to make the binding permanent
@ -554,9 +556,10 @@ class Model extends Overloadable {
* *
* Example: Turn off the associated Model Support request, * Example: Turn off the associated Model Support request,
* to temporarily lighten the User model: * to temporarily lighten the User model:
* <code> *
* $this->User->unbindModel( array('hasMany' => array('Supportrequest')) ); * `$this->User->unbindModel( array('hasMany' => array('Supportrequest')) );`
* </code> *
* unbound models that are not made permanent will reset with the next call to Model::find()
* *
* @param array $params Set of bindings to unbind (indexed by binding type) * @param array $params Set of bindings to unbind (indexed by binding type)
* @param boolean $reset Set to false to make the unbinding permanent * @param boolean $reset Set to false to make the unbinding permanent