For performance reasons in a complex app, I switched almost all of my
associations to be dynamically loaded via bindModel (). The problem that I'm
having is that the dynamically associated models with a HABTM relationship
no longer save to the join table.
I've got a model Event that HABTM Contact. In my EventController::add ()
function, I add the association as such:
$this->Event->bindModel (array (
'hasAndBelongsToMany' => array (
'Contact' => array (
'className' => 'Contact',
'joinTable' => 'contacts_events',
'foreignKey' => 'event_id',
'associationForeignKey' => 'contact_id',
'conditions' => '',
'order' => '',
'uniq' => false,
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
)
));
And the contact field names are data[Contact][Contact][]. This worked
perfectly fine when the association was defined in the model. It also works
when reading the event in show or edit. It only fails on save.
Am I missing something?
Thanks,
Chris
--
Creative Director - IAS
(734) 668-8752 x16
http://www.ias.net
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---