1 | <?php |
||
19 | class UniqueValidator implements ValidatorInterface |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Checks whether the unique constraint is valid for a many-to-many field. |
||
24 | * |
||
25 | * @param array $value |
||
26 | * the value to check |
||
27 | * @param AbstractData $data |
||
28 | * the data to perform the check with |
||
29 | * @param Entity $entity |
||
30 | * the entity to perform the check on |
||
31 | * @param $field |
||
32 | * the many field to perform the check on |
||
33 | * |
||
34 | * @return boolean |
||
35 | * true if it is a valid unique many-to-many constraint |
||
36 | */ |
||
37 | 1 | protected function isValidUniqueMany(array $value, AbstractData $data, Entity $entity, $field) |
|
41 | |||
42 | /** |
||
43 | * Performs the regular unique validation. |
||
44 | * |
||
45 | * @param $value |
||
46 | * the value to validate |
||
47 | * @param $data |
||
48 | * the data instance to validate with |
||
49 | * @param $entity |
||
50 | * the entity of the field |
||
51 | * @param $field |
||
52 | * the field to validate |
||
53 | * @param $type |
||
54 | * the type of the field to validate |
||
55 | * |
||
56 | * @return boolean |
||
57 | * true if everything is valid |
||
58 | */ |
||
59 | 2 | protected function isValidUnique($value, AbstractData $data, Entity $entity, $field, $type) |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | 2 | public function isValid($value, array $parameters) |
|
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | 2 | public function getInvalidDetails() |
|
100 | |||
101 | } |
||
102 |