开发者

Cakephp HABTM relation

i have theses tables article , article_curre开发者_运维知识库ncy, currency in database and i made HABTM between article and currency like this

var $hasAndBelongsToMany = array('currency'=>array('className' => 'currency','joinTable'=>'article_currency','foreignKey' => 'articleid','associationForeignKey' => 'CurrencyID'));

var $hasAndBelongsToMany = array('articlemodel'=>array('className' => 'articlemodel','joinTable'=>'article_currency','foreignKey' => 'CurrencyID','associationForeignKey' => 'ArticleID'));

and here cake genrate the model ArticleCurrency for me when i try to change its name using with to 'article_currency' is give me this error Database table article_currencies for model article_currency was not found.

how i can solve this


Table names are plural by convention: articles, currencies, articles_currencies

http://book.cakephp.org/view/24/Model-and-Database-Conventions

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜