1 | <?php |
||
17 | trait ConstraintTrait |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var EventDispatcherInterface |
||
22 | */ |
||
23 | private $dispatcher; |
||
24 | |||
25 | /** |
||
26 | * @var CustomFactory |
||
27 | */ |
||
28 | private $factory; |
||
29 | |||
30 | /** |
||
31 | * Format constructor. |
||
32 | * |
||
33 | * @param int $checkMode check mode |
||
34 | * @param UriRetriever|null $uriRetriever uri retriever |
||
35 | * @param CustomFactory|null $factory factory |
||
36 | */ |
||
37 | public function __construct( |
||
45 | |||
46 | /** |
||
47 | * sets the event dispatcher |
||
48 | * |
||
49 | * @param EventDispatcherInterface $dispatcher dispatcher |
||
50 | * |
||
51 | * @return void |
||
52 | */ |
||
53 | public function setEventDispatcher(EventDispatcherInterface $dispatcher) |
||
57 | |||
58 | /** |
||
59 | * checks the input |
||
60 | * |
||
61 | * @param mixed $element element |
||
62 | * @param null $schema schema |
||
63 | * @param null $path path |
||
64 | * @param null $i iterator value |
||
65 | * |
||
66 | * @return void |
||
67 | */ |
||
68 | public function check($element, $schema = null, $path = null, $i = null) |
||
79 | |||
80 | /** |
||
81 | * Returns the name of the Event class for this event |
||
82 | * |
||
83 | * @return string event class name |
||
84 | */ |
||
85 | abstract public function getEventClass(); |
||
86 | |||
87 | /** |
||
88 | * Adds errors |
||
89 | * |
||
90 | * @param array $errors errors |
||
91 | * |
||
92 | * @return void |
||
93 | */ |
||
94 | abstract public function addErrors(array $errors); |
||
95 | } |
||
96 |