Containable Behavior This model behavior allows you to filter and limit model find operations.Containable allows you to streamline and simplify operations on your model bindings. It works by temporarily or permanently altering the associations of your models. To use the new behavior, you can add it to the $actsAs property of your model: class Post extends AppModel { public $actsAs = array ( 'Containable' ); } You can also attach the behavior on the fly: $this -> Post -> Behaviors -> load ( 'Containable' ); You can also invoke Containable’s magic from inside the find() call: $this -> Post -> find ( 'all' , array ( 'contain' => false )); $this -> Post -> find ( 'all' , array ( 'contain' => 'Comment.author' )); You can also filter the associated Comment data by specifying a condition: $this -> Post -> find ( 'all' , array ( 'contain...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.