On Feb 25, 2:53 pm, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
> I tried with just something simple:
>
> $dbpermit = $this->Permit->find('first', array(
> 'conditions' => array(
> 'Permit.id' => $id
> ),
> 'contain' => array(
> 'Leader'
> )
> ));
>
> which worked as expected, grabbing the Permit info and the Leader
> info. Then I added one more level of complexity to it:
>
> $dbpermit = $this->Permit->find('first', array(
> 'conditions' => array(
> 'Permit.id' => $id
> ),
> 'contain' => array(
> 'Leader' => array('Country')
> )
> ));
>
> And this is where the problems start. I get Permit and Leader info as
> before, but no Country info. So it seems to me like contain just is
> not recognizing a second contain array inside of itself.
>
> On Feb 25, 2:30 pm, John Andersen <j.andersen...@gmail.com> wrote:
>
> > Ok, understood :)
>
> > Then maybe take it step by step - make a find from Permit with contain
> > Leader and nothing more.
> > If it works, expand the find with Country.
> > If it still works, expand with ProvState.
> > and so on.
>
> > Then tell us your result of the step by step method :)
> > John
>
> > On Feb 25, 10:24 pm, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:> I had indeed read the same things as you had. I did try them, but I
> > > was leery to say the least. I have never defined the foreignKey in the
> > > fields array and I've never had a problem. Same with defining the
> > > models. I never work directly on those models ever, so I don't need
> > > them. Same goes for RegistrationLocation and Activity, they do not
> > > have their own model files and yet still work properly. So needless to
> > > say, those solutions did not bear fruit either.
>
> > > Because there is so much similarity between models that are giving me
> > > the right data and this one. And the fact that this one gives me the
> > > right data when the find is called on itself. I am lead to believe
> > > that the error is in some way I am writing the contain array, however
> > > everything I have read has told me write the array in that manner,
> > > which just adds to my confusion.
>
> > [snip]
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