about 9 years ago
By using Containable Behavior we can filter model assoceation. we use 'Containable' keyword for use contain
we add this property in model
copytext
class User extends AppModel { public $actsAs = array('Containable');}
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');
$this->User->contain('Post'); $this->User->find('all');
Can you help out the community by solving one of the following PHP problems?
Finding Banned Words On A Page And Not Within Other...
Shopping cart quantity counter incrementer?
Regex To Extract 2nd Level Domains From All TLDs ?
Do activity (Answer, Blog) > Earn Rep Points > Improve Rank > Get more opportunities to work and get paid!
For more topics, questions and answers, please visit the Tech Q&A page.
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)