Re: Automatic foreignKey in $hasMany

2009-01-13 Thread cornern...@gmail.com
A Comment can be related to any other model. For example Event 123 could have a comment which would look like this: INSERT INTO comments ('class','foreign_id','name','body') VALUES ('Event',123,'title','comment body'); Or Post 456 may have a comment which would look like this: INSERT INTO commen

Automatic foreignKey in $hasMany

2009-01-12 Thread kicaj
Hi I use this example: http://mrphp.com.au/code/code-category/cakephp/cakephp-1-2/attach-comments-any-model-cakephp And I i have a question: In models (Post, Event) we set property 'foreignKey' = 'foreign_id' in $hasMany, so why we must set again in 'view' action in 'Posts' controller: $this- >