I am having trouble associating the multiple models i have with each other.
I have a 'User' that hasOne 'Fan','Artist','Venue','Promoter'.
The 'User' also hasAndBelongsToMany of the same ones (like he can
subscribe to them as well as be one/all of them).
I am using the scaffolding to view the associations with them. The
associations are being added ok but when i view the user, the
associations aren't being picked up. Here are the 'User' model and the
'Artist' model (the fan, artist, venue and promoter models all look the
same).
What am i doing wrong?
(i can supply a url of the scaffolding with the debug set to 2 if you
would like)
<?php
class Artist extends AppModel
{
var $name = 'Artist';
var $belongsTo = 'User';
var $hasAndBelongsToMany = 'User';
}
?>
<?php
class User extends AppModel
{
var $name = 'User';
var $hasOne = array('Fan' =>
array('className' => 'Fan',
'conditions' => '',
'order' => '',
'dependent' => true,
'foreignKey' => 'user_id'
),
'Artist' =>
array('className' => 'Artist',
'conditions' => '',
'order' => '',
'dependent' => true,
'foreignKey' => 'user_id'
),
'Venue' =>
array('className' => 'Venue',
'conditions' => '',
'order' => '',
'dependent' => true,
'foreignKey' => 'user_id'
),
'Promoter' =>
array('className' => 'Promoter',
'conditions' => '',
'order' => '',
'dependent' => true,
'foreignKey' => 'user_id'
),
);
var $hasAndBelongsToMany = array('Fan','Artist','Venue','Promoter');
}
?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---