If it is the first use that as the joinTable value in the association array
--
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/
On 5/31/06, Copot <
[EMAIL PROTECTED]> wrote:
We have 3 tables
1. cms_articles (id, title) - CMS articles
2. shop_categories (id,title) - Categories
3. shop_categories_cms_article (cms_article_id, shop_category_id)
(Articles for a specific category)
Data set:
1. cms_articles (1, 'Article no 1')
2. shop_categories (1, 'Vibrators')
3. shop_categories_cms_articles(1,1) - meaning the category Vibrators
has one article -> Article no. 1
We have the model:
class CmsArticle extends AppModel
{
var $name = 'CmsArticle';
var $hasAndBelongsToMany = array(
'ShopCategory' =>
array('className' => 'ShopCategory',
'conditions' => '',
'order' => '',
'foreignKey' => '',
'joinTable' => 'ShopCategoriesCmsArticle',
'associationForeignKey' => '',
'uniq' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''),
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---