开发者

What is the differences between bind model and contain cakephp?

开发者 https://www.devze.com 2023-03-06 04:41 出处:网络
What is the di开发者_JAVA技巧fferences between bind model and contain cakephp? any one have idea please share with me.. I am new to cakephp Note: this answer relates to version 1.3 of CakePHP which is

What is the di开发者_JAVA技巧fferences between bind model and contain cakephp? any one have idea please share with me.. I am new to cakephp


Note: this answer relates to version 1.3 of CakePHP which is no longer supported.

One of the most powerful features of CakePHP is the ability to link relational mapping provided by the model. In CakePHP, the links between models are handled through associations. If you set up these associations in your model, then when you retrieve your data Cake will automagically retrieve associated data too.

The containable behavior allows you to filter and limit model find operations (assuming you have set up your model associations)

https://book.cakephp.org/1.3/en/The-Manual/Core-Behaviors/Containable.html

bind and unbind are useful for changing model associations on the fly:

https://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Models.html#creating-and-destroying-associations-on-the-fly

0

精彩评论

暂无评论...
验证码 换一张
取 消