I guess the difference between what I'm doing and your solution is that
if the the composite key combination is already set then I want to
overwrite it. It is sort of like how Cake automatically checks if the
id exists to determine if it should do an insert or an update.
So I guess my suggestion would be to use option 1 you described at the start. I wouldn't recommend changing the way the primary key is stored as that could have unpredictable results with cake since it relies on it to interface with your table. If it works now, an update to the cake core may break it.
If for some reason you only wanted to have an alternate plan in case of a duplicate, you could wait until the duplicate error occured using something similar to what I suggested, then get the id for the existing row, and resave (so option 1 only if error occurs).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
