Country and ProvState model contained in Leader, that is what is
expected. In the first one, I expect the same, while also getting back
RegistrationLocation, User, and Activity. For the second one, I get
all the right data, except I get no Country and ProvState as I believe
I should be with them in the contain array, I even get the Leader
data, just not what is associated with Leader.
I did your suggestion earlier in my own testing, and I still don't get
Country and ProvState as I expect too get.
On Feb 25, 6:17 am, John Andersen <j.andersen...@gmail.com> wrote:
> What result are you getting and what is the expected result? Do you
> get errors or nothing at all?
> Just to compare your two finds, could you remove User,
> RegistrationLocation and Activity from the second find and retry!
> Enjoy,
> John
>
> On Feb 25, 9:22 am, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
>
> > 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@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment