1 | <?php |
||
13 | class ValidatorStep implements PriorityStep |
||
14 | { |
||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $constraints = []; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | private $violations = []; |
||
24 | |||
25 | /** |
||
26 | * @var boolean |
||
27 | */ |
||
28 | private $throwExceptions = false; |
||
29 | |||
30 | /** |
||
31 | * @var integer |
||
32 | */ |
||
33 | private $line = 1; |
||
34 | |||
35 | /** |
||
36 | * @var ValidatorInterface |
||
37 | */ |
||
38 | private $validator; |
||
39 | |||
40 | /** |
||
41 | * Possible options to set for Constraints\Collection |
||
42 | * @var array |
||
43 | */ |
||
44 | private $possibleOptions = [ 'groups', 'allowExtraFields', 'allowMissingFields', 'extraFieldsMessage', 'missingFieldsMessage' ]; |
||
45 | |||
46 | /** |
||
47 | * @param ValidatorInterface $validator |
||
48 | */ |
||
49 | 4 | public function __construct(ValidatorInterface $validator) |
|
53 | |||
54 | /** |
||
55 | * @param string $field |
||
56 | * @param Constraint $constraint |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | 3 | public function add($field, Constraint $constraint) |
|
70 | |||
71 | /** |
||
72 | * @param boolean $flag |
||
73 | */ |
||
74 | 1 | public function throwExceptions($flag = true) |
|
78 | |||
79 | /** |
||
80 | * @return array |
||
81 | */ |
||
82 | 2 | public function getViolations() |
|
86 | |||
87 | /** |
||
88 | * Add additional options for the constraints |
||
89 | * @param string $option |
||
90 | * @param $optionValue |
||
91 | */ |
||
92 | 1 | public function addOption($option, $optionValue) |
|
100 | |||
101 | /** |
||
102 | * {@inheritdoc} |
||
103 | */ |
||
104 | 3 | public function process(&$item) |
|
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 1 | public function getPriority() |
|
129 | } |
||
130 |