Merge branch 'birthdate_constraint' into 'master'

Birthdate constraint

ref #4 

See merge request !3
This commit is contained in:
2015-12-11 14:55:48 +01:00
11 changed files with 335 additions and 41 deletions

View File

@@ -48,3 +48,11 @@ services:
tags:
- { name: security.voter }
- { name: chill.role }
chill.person.birthdate_validation:
class: Chill\PersonBundle\Validator\Constraints\BirthdateValidator
arguments:
- "%chill_person.validation.birtdate_not_before%"
tags:
- { name: validator.constraint_validator, alias: birthdate_not_before }

View File

@@ -22,6 +22,8 @@ Chill\PersonBundle\Entity\Person:
- Date:
message: 'Birthdate not valid'
groups: [general, creation]
- Chill\PersonBundle\Validator\Constraints\Birthdate:
groups: [general, creation]
gender:
- NotNull:
groups: [general, creation]

View File

@@ -11,3 +11,4 @@
'Closing date is not valid': 'La date de fermeture n''est pas valide'
'Closing date can not be null': 'La date de fermeture ne peut être nulle'
The date of closing is before the date of opening: La période de fermeture est après la période d'ouverture
The birthdate must be before %date%: La date de naissance doit être avant le %date%