I want to validate the data contained by Value Objects before inserting into the database (e.g. check that php string is smaller than 255 chars before inserting into a column of type varchar(255)
or that a string is not inserted in an int(11)
table column, php date has the correct format etc.).
Is there any framework or easy way to validate data before SQL INSERT
or UPDATE
operations?
Thanks!