add validation for phonenumber

This commit is contained in:
Julien Fastré 2018-08-20 21:36:07 +02:00
parent ca445f11c5
commit c21b87b9c6

View File

@ -40,11 +40,17 @@ Chill\PersonBundle\Entity\Person:
pattern: '/^([\+{1}])([0-9\s*]{4,20})$/'
groups: [general, creation]
message: 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33123456789'
- Chill\MainBundle\Validation\Constraint\PhonenumberConstraint:
type: landline
groups: [ general ]
mobilenumber:
- Regex:
pattern: '/^([\+{1}])([0-9\s*]{4,20})$/'
groups: [general, creation]
message: 'Invalid phone number: it should begin with the international prefix starting with "+", hold only digits and be smaller than 20 characters. Ex: +33623456789'
- Chill\MainBundle\Validation\Constraint\PhonenumberConstraint:
type: mobile
groups: [ general ]
constraints: