Hi Villas,

HABTM works without any problem. Maybe because I was just being lazy
and just 'baked' my models. Hereby a working example of a working
HABTM model:

article.php:
class Article extends AppModel {

        var $name = 'Article';
        var $useTable = 'articles';
        var $primaryKey = 'article_ID';
        var $hasAndBelongsToMany = array(
                        'Tag' => array('className' => 'Tag',
                                                'joinTable' => 'articles_tags',
                                                'foreignKey' => 'article_ID',
                                                'associationForeignKey' => 
'tag_ID',
                                                'unique' => true ) ); }

tag.php:
class Tag extends AppModel {

        var $name = 'Tag';
        var $useTable = 'tags';
        var $primaryKey = 'tag_ID';
        var $hasAndBelongsToMany = array(
                        'Article' => array('className' => 'Article',
                                                'joinTable' => 'articles_tags',
                                                'foreignKey' => 'tag_ID',
                                                'associationForeignKey' => 
'article_ID',
                                                'unique' => true )); }

--~--~---------~--~----~------------~-------~--~----~
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