I was just having the same problem, used your method and it's working
fine now.

On Mar 30, 9:36 pm, "ste.ve" <[EMAIL PROTECTED]> wrote:
> To visualize it better, these are my example Model definitions
>
> WORKS:
>
> class Tag extends AppModel {
>
>         var $hasAndBelongsToMany = array(
>                                  'Tag2' => array(
>                                                         'foreignKey' => 
> 'tag_id',
>
> 'associationForeignKey' => 'tag2_id', )
>                                 );
>
> }
>
> class Tag2 extends AppModel {
>
>         var $useTable = "tags";
>
>         var $hasAndBelongsToMany = array(
>                                  'Tag' => array(
>                                          'foreignKey' => 'tag2_id',
>                                          'associationForeignKey' => 'tag_id',
>                         ));
>
> }
>
> DOESN'T WORK (in the result set, all rows for Tag2 contain the value
> from Tag - the number of results is correct, anyhow)
>
> class Tag extends AppModel {
>
>         var $hasAndBelongsToMany = array('Tag2' );
>
> }
>
> class Tag2 extends AppModel {
>
>         var $useTable = "tags";
>
>         var $hasAndBelongsToMany = array( 'Tag' );
>
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to