Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: 1.2.1
-
Fix Version/s: 1.2.2
-
Component/s: Validators
-
Labels:None
-
Environment:PostgreSQL 8.4, PHP 5.2.11, Apache2
Description
I'm generating my models from YAML. The email validator is correctly parsed into the model, but it doesn't work. If I try to insert 'a' or something that is not valid, I don't get any error at all and the row is inserted. See attachments for models.
$user = new AppUser();
$user->name = 'Testuser';
$user->password = sha1('lala');
$user->email = 'a';
$user->role = 'ADMIN';
$user->save();
Is Validation activated for your Connection/Manager via the attributes ? It's off by default.
From the manual:
http://www.doctrine-project.org/documentation/manual/1_2/en/configuration#naming-convention-attributes:validation-mode-constants
Validation by default is turned off so if you wish for your data to be validated you will need to enable it. Some examples of how to change this configuration are provided below.