A present for you all: tbDuplicateKeyPlugin catches duplicate key errors at the MySQL level and converts them into user-friendly Symfony validation errors. This is really handy for catching things like duplicate names and so on without duplicate labor on the programmer's part. Because it works at the database error level, the plugin is MySQL and Propel-specific.
It works great with Symfony 1.0, and my educated guess is that it will work with 1.1 and 1.2; you tell me. (And send patches!) Catching errors of this type at the database level is more robust than using a validator because a validator can still result in a race condition when two users attempt to add things with the same unique key at the same time. It is also faster, because the validator approach requires a redundant query to find out if a name has already been taken. It's pretty handy, but it's not quite magic, so be sure to read the README and make the two necessary small additions to your admin module's actions.class.php. -- Tom Boutell www.punkave.com www.boutell.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" 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/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
