[symfony-users] Re: Handling Foreign Key Constraints in the applcation

2007-08-01 Thread Marc Torres
Wouldn't be better to make use of validators [1]? This way you can assure that all foreign key constrains are fulfilled [1] http://www.symfony-project.com/book/trunk/10-Forms#Form%20Validation Cheers, Marc 2007/8/1, Michael Smith <[EMAIL PROTECTED]>: > > > You have to pares the exception mess

[symfony-users] Re: Handling Foreign Key Constraints in the applcation

2007-07-31 Thread Michael Smith
You have to pares the exception message to determine if it was a foreign key and which one it was. I wish there was a cleaner way of doing it but the function below works for mysql at least. /** * Parses out the table, field, and error message from a foreign key failure