Some doubts regarding associations in CakePHP
Hi I've got a couple of questions regarding associations and how they play in cases
of complex find() calls.
- If I've got a model Post and a model Comment with the latter having a parent_id field and I want to fetch a post with its associated comments threaded, do I simply perform a find('threaded', ...) on Post itself or will this result in an error because Post doesn't have a parent_id? I am particularly concerned about a Containable + Threaded find. (the example I give here is a simplified version of what I actually need to implement)
- What is the significance of Association Names? Does Containable work on association names or model names? If I am having find conditions referring to an associated model (e.g. 'Post.id'), do I suffix field names with the model name or association name?

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home