Thanks!
On 2 June, 14:21, John Andersen j.andersen...@gmail.com wrote:
Ok, so what you want is:
1) The article;
2) The related comments;
3) The related comment ranks for each comment.
[code]
$this-Article-Comment-find(
'threaded',
array(
'contain' = array('Article',
$this-Article-Comment-find(
'threaded',
array(
'contain' = array('CommentRank'),
'conditions' = array('Article.id' = $id)
)
);
^^ Sorry it was a typo in the post; the code above is from my
application. It does return an Array but doesn't use the containable
behavior;
Ok, so what you want is:
1) The article;
2) The related comments;
3) The related comment ranks for each comment.
[code]
$this-Article-Comment-find(
'threaded',
array(
'contain' = array('Article', 'CommentRank'),
'conditions' = array('Comment.article_id' = $id)
)
);
[/code]
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') =
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