Yeah, I started looking into the data source but since it is such a rare situation: A table with multi-column pk that will only very rarely be rebuilt from the original data, I thought it simplest to just build a custom save-function that builds the query from static strings and the provided model array.
Possibly there could in some future version just be support for an appended query snippet in Cakes model-functions. Group by statements is another situation where a snippet is just entered as the last condition but could be added using the same mechanism. I suppose I could dive into MySQL and triggers and things but then I would be even further away from the comfort of Cake :) Thanks for your thoughts though. /Martin On Jul 2, 5:02 pm, Joel Perras <[EMAIL PROTECTED]> wrote: > I believe the best starting point would be to extend the datasource > for your specific database. > > Alternatively, I believe this problem could be solved in terms of a > trigger, but I'd have to think a bit more about that. > > -Joel. > > On Jul 2, 10:17 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > I found myself in an new situation. A table of aggregateable data > > (StarSchema type of setup so this will be the source of the > > aggregations) should ideally be updatable. Since it is a fact table > > there will be a lot of data and I would love it if I could avoid some > > queries. > > > Being able to tack on a "...ON DUPLICATE KEY UPDATE..." to the end of > > my save would save me looking for existing rows before saving. New > > ones would be created and existing ones would be updated. When just > > the saves will be a few thousands per "day" aggregated data > > > I have resorted to writing the query manually for now but it would be > > nice to be able to stay in the warm comfort of Cake methods. Has > > anybody extended a model's save() in this way or anything similar I > > can look at as a starting-point? > > > /Martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
