By using Containable Behavior we can filter model assoceation. we use 'Containable' keyword for use contain
we add this property in model
class User extends AppModel {
public $actsAs = array('Containable');
}
and we can use this on fly also
$this->User->Behaviors->load('Containable');
and we use it when we use our query
$this->User->contain('Post');
$this->User->find('all');
0 Comment(s)