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