Re: HABTM Manual foriegn key error?

2006-05-25 Thread olle

Since you tried this, and got the expected result with your new piece
of code, this idea is ripe for a Ticket.

Thanks for taking care of details, mate.

-Olle


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



HABTM Manual foriegn key error?

2006-05-23 Thread lifebythedrop

In the Cake manual chapter for models, in HABTM associations section
there is the example code for Post/Tag relationship pasted below...

Shouldn't foreignKey and associationForeignKey be swapped?

I tried the way the manual has, but no records returned, swapping these
2 fields return the expected results.  I dont know for sure though, so
figured I'd ask the experts.

class Post extends AppModel
{
var $name = 'Post';
var $hasAndBelongsToMany = array('Tag' =
   array('className'  = 'Tag',
 'joinTable'  = 'posts_tags',
 'foreignKey' = 'tag_id',
 'associationForeignKey'=
'post_id',
 'conditions' = '',
 'order'  = '',
 'limit'  = '',
 'uniq'   = true,
 'finderSql'  = '',
 'deleteQuery'= '',
   )
   );
}


Regards,


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---