I got user has many event, event belongsTo eventtype and user,
eventtype has many event
make sense? did I set this up right?
I trying to fetch all the data for one event.
Following the example in the cookbook, I tried this:
$this->User->find('all', array(
'conditions' => array('User.id =' => $user_id,
'contain' => array(
'Event' => array(
'Eventtype' => array(
'fields' =>
array('id','eventName')
)
)
)
)));
It fetches the user and event data fine, but won't go to the eventtype
level.
I also tried manually binding as it was suggested here, but this
didn't work either:
$this->User->Event->bindModel(array('belongsTo' => array(
'Eventtype' => array(
'className' => 'Eventtype',
'foreignKey' => false,
'fields' => array('id','typeName'),
'conditions' => 'Eventtype.id = Event.type_id'
)
)));
any suggestions? thanks.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---