Change the join alias name as follows
class Topic extends AppModel {
var $name = 'Topic';
var $hasMany = array(
'SubTopic' => array(
'className' => 'Topic',
'foreignKey' => 'parent_id'
)
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
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