I'd create a behavior. Of course models shouldn't access components, so the logic from the component should be transferred to the behavior itself. Something like this: http://pastebin.sk/en/1752/ (not tested, just quickly written)
Cheers grigri On 30 May, 22:53, Langdon Stevenson <[EMAIL PROTECTED]> wrote: > Interesting solution. I have been generating UUIDs in PHP for one of my > projects as my ISP only offers MySQL 4.x. > > Regards, > Langdon > > Divagater wrote: > > I use database triggers to handle writing UUID's for all of my id's. > > This is not a PHP solution and may or may not be appropriate for > > scalability across a wide range of databases. In MySQL a trigger to to > > add a UUID as the id of a particular table would look like this: > > > CREATE TRIGGER `posts_id` BEFORE INSERT ON `posts` FOR EACH ROW SET > > NEW.id = UUID(); > > > Cheers, > > Divagater --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
