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 | private $possibleOptions = [ 'groups', 'allowExtraFields', 'allowMissingFields', 'extraFieldsMessage', 'missingFieldsMessage' ]; |
||
41 | |||
42 | /** |
||
43 | * @param ValidatorInterface $validator |
||
44 | */ |
||
45 | 4 | public function __construct(ValidatorInterface $validator) |
|
49 | |||
50 | /** |
||
51 | * @param string $field |
||
52 | * @param Constraint $constraint |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | 3 | public function add($field, Constraint $constraint) |
|
66 | |||
67 | /** |
||
68 | * @param boolean $flag |
||
69 | */ |
||
70 | 1 | public function throwExceptions($flag = true) |
|
74 | |||
75 | /** |
||
76 | * @return array |
||
77 | */ |
||
78 | 2 | public function getViolations() |
|
82 | |||
83 | /** |
||
84 | * Add additional options for the constraints |
||
85 | * @param string $option |
||
86 | * @param $optionValue |
||
87 | */ |
||
88 | 1 | public function addOption($option, $optionValue) |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | 3 | public function process(&$item) |
|
117 | |||
118 | /** |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | 1 | public function getPriority() |
|
125 | } |
||
126 |