Tuesday, June 1, 2010

Re: Containable() not working for $this->Model1->Model2->find('', array('contain') => 'Model3');

I do hope it is only a typo in the post and not in your code!

[code]
$this->Model1->Model2->find(
'threaded',
array('contain' => 'Model3')
);
[/code]

Is the above what is not working?
Have you checked that an association/relationship is defined between
Model2 and Model3?
Enjoy,
John

On Jun 1, 8:14 pm, Shaz <shazam...@gmail.com> wrote:
> I'm trying to avoid putting $uses at the top of my controller and
> aiming to make do with model associations, but alas containable()
> doesn't work when trying:
>
> $this->Model1->Model2->find('threaded', array('contain') => 'Model3');
>
> But:
>
>  $this->Model1->find('threaded', array('contain') => 'Model2.Model3');
>
> Provides me a threaded result, containable works, but the find results
> not in the array structure I want (using parent_id to make threaded
> comments)...

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: