1 | <?php |
||
10 | class EcuadorIdentificationValidator extends Validator |
||
11 | { |
||
12 | /** |
||
13 | * Determine if the value is valid |
||
14 | * |
||
15 | * @var bool |
||
16 | */ |
||
17 | private $isValid = false; |
||
18 | |||
19 | /** |
||
20 | * Validation types |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | private $types = [ |
||
25 | 'personal_identification' => 'validatePersonalIdentification', |
||
26 | 'natural_ruc' => 'validateNaturalPersonRuc', |
||
27 | 'public_ruc' => 'validatePublicCompanyRuc', |
||
28 | 'private_ruc' => 'validatePrivateCompanyRuc', |
||
29 | 'final_customer' => 'validateFinalConsumer', |
||
30 | 'ruc' => 'validateRuc', |
||
31 | 'all_identifications' => 'validateAllIdentificatons', |
||
32 | 'is_juridical_person' => 'validateIsJuridicalPersons', |
||
33 | 'is_natural_person' => 'validateIsNaturalPersons', |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * Validate that the Ecuadorian identification is valid |
||
38 | * |
||
39 | * @param $attribute |
||
40 | * @param $value |
||
41 | * @param $parameters |
||
42 | * @return bool |
||
43 | * @throws EcuadorIdentificationException |
||
44 | */ |
||
45 | public function validateEcuador($attribute, $value, $parameters) |
||
64 | |||
65 | /** |
||
66 | * Get the translated message or the default message. |
||
67 | * |
||
68 | * @param $attribute |
||
69 | * @param $rule |
||
70 | * @return mixed|string |
||
71 | */ |
||
72 | protected function getMessageEcuador($attribute, $rule) |
||
80 | |||
81 | /** |
||
82 | * Get the translated attribute or the default attribute. |
||
83 | * |
||
84 | * @param $attribute |
||
85 | * @return mixed |
||
86 | */ |
||
87 | protected function getAttributeEcuador($attribute) |
||
95 | } |
||
96 |