Re: Self-Join a Model

2016-01-15 Thread shidhu40
Change the join alias name as follows class Topic extends AppModel { var $name = 'Topic'; var $hasMany = array( 'SubTopic' => array( 'className' => 'Topic', 'foreignKey' => 'parent_id' )

Re: Self-Join a Model

2009-11-14 Thread LancerForHire
The name collision has been fixed and everything is working dandy. Thanks a bunch Jeff! On Nov 14, 4:59 pm, Jeff Deroshia wrote: > You have a name collision for starters.  The class Topic has the name Topic, > and its Associations have the same name.  You can try changing the aliases > like hasMa

Re: Self-Join a Model

2009-11-14 Thread Jeff Deroshia
You have a name collision for starters. The class Topic has the name Topic, and its Associations have the same name. You can try changing the aliases like hasMany ChildTopic and belongsTo ParentTopic. Just make sure to keep the className as Topic. Jeff On Sat, Nov 14, 2009 at 1:22 PM, LancerF