1 | <?php |
||
32 | class FormHelper { |
||
33 | |||
34 | use EventDispatcherTrait; |
||
35 | use ObjectManagerTrait; |
||
36 | |||
37 | /** |
||
38 | * Service name. |
||
39 | * |
||
40 | * @avr string |
||
41 | */ |
||
42 | const SERVICE_NAME = "webeweb.core.helper.form"; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * |
||
47 | * @param ObjectManager $objectManager The object manager. |
||
48 | * @param EventDispatcherInterface $eventDispatcher The event dispatcher. |
||
49 | */ |
||
50 | public function __construct(ObjectManager $objectManager, EventDispatcherInterface $eventDispatcher) { |
||
54 | |||
55 | /** |
||
56 | * Check an entity type. |
||
57 | * |
||
58 | * @param $collection The collection. |
||
59 | * @param string $notification The notification. |
||
60 | * @param string $redirectURL The redirect URL. |
||
61 | * @param int $expected The expected count. |
||
62 | * @throws IllegalArgumentException Throws an illegal argument exception if collection is null. |
||
63 | * @throws RedirectResponseException Throws a redirect response exception if the collection is less than $expected. |
||
64 | */ |
||
65 | public function checkCollection($collection, $notification, $redirectURL, $expected = 1) { |
||
92 | |||
93 | /** |
||
94 | * On post handle request with collection. |
||
95 | * |
||
96 | * @param Collection $oldCollection The old collection. |
||
97 | * @param Collection $newCollection The new collection. |
||
98 | * @return int Returns the deleted count. |
||
99 | */ |
||
100 | public function onPostHandleRequestWithCollection(Collection $oldCollection, Collection $newCollection) { |
||
111 | |||
112 | /** |
||
113 | * On pre handle request with collection. |
||
114 | * |
||
115 | * @param Collection $collection The collection. |
||
116 | * @return Collection Returns the cloned collection. |
||
117 | */ |
||
118 | public function onPreHandleRequestWithCollection(Collection $collection) { |
||
125 | |||
126 | } |
||
127 |