Tuesday, February 2, 2010

Error in define HABTM relation with 'joinTable' and with 'with'

Hi
I'm working on a legacy system , i must to defina an HABTM relation
between User and Group. In User model I have this:

var $hasAndBelongsToMany=array(
'Group' =>array(
'className' => 'Group',
'joinTable' => 'utenti_gruppi',
'with' => 'GroupsUser',
'foreignKey' => 'username',
'associationForeignKey'=> 'gruppo_id',
'order' => 'gruppo_nome ASC'
)
);

But I get this error:

Error: Database table groups_users for model GroupsUser was not
found.

Is it not possible define a HABTM relation with 'with' and with
'joinTable' that I want?
Many Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate