cake-php@googlegroups.com
[Top] [All Lists]

Problem with recursion and Containable

Subject: Problem with recursion and Containable
From: "Arak Tai'Roth"
Date: Wed, 24 Feb 2010 23:22:11 -0800 PST
So I've been searching for a solution to my problem for a little while
now. However everything I find seems to imply that what I am doing is
correct, so I am rather confused about this at the moment. Likely it's
something simple, but I'm sure as heck not seeing it.

I have a model named Leader, which belongsTo Country and ProvState.
When I retrieve Leader information, I also want to get info on Country
and ProvState. I also have a model Permit, which belongsTo Leader.

I am using Containable, and it is in app_model.

This find call works properly and retrieves everything from Leader,
Country, and ProvState properly.
$dbleader = $this->Leader->find('first', array(
                                'conditions' => array(
                                        'Leader.id' => $id
                                ),
                                'contain' => array(
                                        'Country', 'ProvState'
                                )
                        ));

However, this does not:
$dbpermit = $this->Permit->find('first', array(
                                'conditions' => array(
                                        'Permit.id' => $id
                                ),
                                'contain' => array(
                                        'Leader' => array('Country', 
'ProvState'), 'User',
'RegistrationLocation', 'Activity'
                                )
                        ));

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

<Prev in Thread] Current Thread [Next in Thread>