Hi,
I've got 3 tables
users, events and user_has_events
In my model user, I have added the relation hasmany on
user_has_events, did same thing on event model.
user_has events must have 2 relations belongsTo.
Each record in this table have one and only one event and one and only
one user
I've tried to assign in belongsTo var but nothing works
var $belongsTo = array('User');
var $belongsTo = 'User';
var $belongsTo = array('User' => array('className' =>
'User','foreignKey' => 'user_id'));
In the controller, I made a print_r to see associated models
echo "<pre>"; print_r($this->EventsHasUsers->getAssociated());echo "</
pre>";
with every exemples above, the array is always empty
but if I do
$this->EventsHasUsers->bindModel(array('belongsTo' => array('User' =>
array('className' => 'User'))));
the array getAssociated contains
Array
(
[User] => belongsTo
)
Where is my error ?
thanks for helping.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---