Sunday, February 28, 2010

Re: falsefalse

Ok, if you don't use the Country model, then you are using the
AppModel, how does it look like?
Enjoy,
John

On Feb 28, 10:31 am, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
> They are all lowercase, I'm not that new at this.
>
> Exact code for the leader model for the relationships was already
> posted above.
>
> And as I said, I tested it with a Country model and that did not help,
> and as such I removed it as I don't see a point in a file that doesn't
> add any value.
>
> On Feb 28, 2:14 am, John Andersen <j.andersen...@gmail.com> wrote:
>
> > Ok, that is fine, but can you tell me exactly what are the filenames
> > of your models?
> > They should all be lowercase!
> > Also please show the exact code for the Leader model (leader.php) and
> > the Country model (country.php) from the beginning to the end of the
> > relationship/association definition.
> > Enjoy,
> >    John
>
> > On Feb 28, 8:15 am, "Arak Tai'Roth" <nielsen.dus...@gmail.com> wrote:
>
> > > I did indeed do that when you had first asked me if I had made the
> > > model. It didn't change anything.
>
> > > On Feb 26, 12:43 am, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > > I would first try to create the Country model, with all the necessary
> > > > associations/relationships, and then try again.
> > > > Enjoy,
> > > >    John
>
> > > > On Feb 25, 10: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: