1 | <?php |
||
19 | class PhoneNumberValidator extends Validator |
||
20 | { |
||
21 | /** |
||
22 | * @var string If a phone number does not contain the country prefix (+41 f.e), define a default country format which then defines the |
||
23 | * country prefix. |
||
24 | * |
||
25 | * ```php |
||
26 | * 'country' => 'CH', |
||
27 | * ``` |
||
28 | */ |
||
29 | public $country; |
||
30 | |||
31 | /** |
||
32 | * @var boolean Whether the phone number value should be standardized with formating function and write back to the model. This is usefull |
||
33 | * in order to have all phone numbers save in the correct format in the database. |
||
34 | */ |
||
35 | public $autoFormat = true; |
||
36 | |||
37 | /** |
||
38 | * @var string The format which should be taken to auto format the phone number value. |
||
39 | */ |
||
40 | public $autoFormatFormat = PhoneNumberFormat::E164; |
||
41 | |||
42 | /** |
||
43 | * {@inheritDoc} |
||
44 | */ |
||
45 | public function validateAttribute($model, $attribute) |
||
67 | } |