Re: Contain conditions based off parents data.

2012-06-11 Thread Dave Milsom
Call the find on the ParentsDomain model instead: $this-Domain-ParentDomain-find('all', array('conditions' = array(ParentDomain.chronicle_id=1))); On Sunday, June 10, 2012 11:45:48 PM UTC-4, Michael wrote: So I have a table called Domains which has a parent_id allowing the domains to

Re: Contain conditions based off parents data.

2012-06-11 Thread Karey Powell
It can be done in one command. I had a similar problem the other day and I solved it by initializing the constructor in the Model I wanted this to work on and created a VirtualField, and by specifying the $this-alias CakePHP could then pick up the association and find the appropriate column.

Contain conditions based off parents data.

2012-06-10 Thread Michael Gaiser
So I have a table called Domains which has a parent_id allowing the domains to contain a parent/child relationship, the parent being referred to as ParentDomain. For the case I am working on, the ParentDomain has a variable called chronicle_id. The condition I want to make will get all domains

Re: Contain conditions based off parents data.

2012-06-10 Thread Angad Nadkarni
$this-ParentDomain-hasMany['ParentDomain']['conditions'] = 'ParentDomain.chronicle_id = 1'; On Jun 11, 8:45 am, Michael Gaiser mjgai...@gmail.com wrote: So I have a table called Domains which has a parent_id allowing the domains to contain a parent/child relationship, the parent being referred

Re: Contain conditions

2009-08-03 Thread brian
That couldn't be set in the class variable but you could add it into the array within the action. public $paginate = array( 'Post' = array( ... ) ); public function function index() { $this-paginate['Post']['contain'] = array( ...

Contain conditions

2009-08-02 Thread Dave Maharaj :: WidePixels.com
Just wondering if this is possible or how to go about it Site has Posts from various users Now a User can bookmark posts they like and save them, now when they view the posts/index page how can i set pagination to contain so that it does not shows posts that the user has saved. Dave