From c21b87b9c65469497cf50005322b638a9c6d5df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 20 Aug 2018 21:36:07 +0200 Subject: [PATCH] add validation for phonenumber --- Resources/config/validation.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Resources/config/validation.yml b/Resources/config/validation.yml index d201c516e..a430847e5 100644 --- a/Resources/config/validation.yml +++ b/Resources/config/validation.yml @@ -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: