1 | <?php |
||
41 | abstract class AbstractController extends BaseController { |
||
42 | |||
43 | /** |
||
44 | * Dispatch an event. |
||
45 | * |
||
46 | * @param string $eventName The event name. |
||
47 | * @param BaseEvent $event The event. |
||
48 | * @return BaseEvent|null Returns the event in case of success, null otherwise. |
||
49 | */ |
||
50 | protected function dispatchEvent($eventName, BaseEvent $event) { |
||
54 | |||
55 | /** |
||
56 | * Get the container. |
||
57 | * |
||
58 | * @return Container|null Returns the container in case of success, null otherwise. |
||
59 | */ |
||
60 | protected function getContainer() { |
||
63 | |||
64 | /** |
||
65 | * Get the event dispatcher. |
||
66 | * |
||
67 | * @return EventDispatcherInterface|null Returns the event dispatcher in case of success, null otherwise. |
||
68 | */ |
||
69 | protected function getEventDispatcher() { |
||
72 | |||
73 | /** |
||
74 | * Get the form helper. |
||
75 | * |
||
76 | * @return FormHelper|null Returns the form helper in case of success, null otherwise. |
||
77 | */ |
||
78 | protected function getFormHelper() { |
||
81 | |||
82 | /** |
||
83 | * Get the kernel event listener. |
||
84 | * |
||
85 | * @return KernelEventListener|null Returns the kernel event listener in case of success, null otherwise. |
||
86 | */ |
||
87 | protected function getKernelEventListener() { |
||
90 | |||
91 | /** |
||
92 | * Get the logger. |
||
93 | * |
||
94 | * @return LoggerInterface|null Returns the logger in case of success, null otherwise. |
||
95 | */ |
||
96 | protected function getLogger() { |
||
99 | |||
100 | /** |
||
101 | * Get the repository helper. |
||
102 | * |
||
103 | * @return RepositoryHelper|null Returns the repository helper in case of success, null otherwise. |
||
104 | */ |
||
105 | protected function getRepositoryHelper() { |
||
108 | |||
109 | /** |
||
110 | * Get the repository report helper. |
||
111 | * |
||
112 | * @return RepositoryHelper|null Returns the repository helper in case of success, null otherwise. |
||
113 | * @deprecated since 2.15.0, use {@see WBW\Bundle\CoreBundle\Controller\AbstractController::getRepositoryHelper()} instead. |
||
114 | */ |
||
115 | protected function getRepositoryReportHelper() { |
||
118 | |||
119 | /** |
||
120 | * Get the router. |
||
121 | * |
||
122 | * @return RouterInterface|null Returns the router in case of success, null otherwise. |
||
123 | */ |
||
124 | protected function getRouter() { |
||
127 | |||
128 | /** |
||
129 | * Get the session. |
||
130 | * |
||
131 | * @return SessionInterface|null Returns the session in case of success, null otherwise. |
||
132 | */ |
||
133 | protected function getSession() { |
||
136 | |||
137 | /** |
||
138 | * Get the translator. |
||
139 | * |
||
140 | * @return TranslatorInterface|null Returns the translator in case of success, null otherwise. |
||
141 | */ |
||
142 | protected function getTranslator() { |
||
145 | |||
146 | /** |
||
147 | * Determines if the connected user have roles or redirect. |
||
148 | * |
||
149 | * @param array $roles The roles. |
||
150 | * @param bool $or OR ? |
||
151 | * @param string $redirectUrl The redirect URL. |
||
152 | * @param string $originUrl The origin URL. |
||
153 | * @return bool Returns true. |
||
154 | * @throws BadUserRoleException Throws a bad user role exception. |
||
155 | */ |
||
156 | protected function hasRolesOrRedirect(array $roles, $or, $redirectUrl, $originUrl = "") { |
||
168 | |||
169 | /** |
||
170 | * Notify. |
||
171 | * |
||
172 | * @param string $eventName The event name. |
||
173 | * @param NotificationInterface $notification The notification. |
||
174 | * @return NotificationEvent|null Returns the event in case of success, null otherwise. |
||
175 | */ |
||
176 | protected function notify($eventName, NotificationInterface $notification) { |
||
179 | |||
180 | /** |
||
181 | * Toast. |
||
182 | * |
||
183 | * @param string $eventName The event name. |
||
184 | * @param ToastInterface $toast The toast. |
||
185 | * @return ToastEvent|null Returns the event in case of success, null otherwise. |
||
186 | */ |
||
187 | protected function toast($eventName, ToastInterface $toast) { |
||
190 | |||
191 | /** |
||
192 | * Translate. |
||
193 | * |
||
194 | * @param string $id The id. |
||
195 | * @param array $parameters The parameters. |
||
196 | * @param string|null $domain The domain. |
||
197 | * @param string|null $locale The locale. |
||
198 | * @return string Returns the translation in case of success, $id otherwise. |
||
199 | */ |
||
200 | protected function translate($id, array $parameters = [], $domain = null, $locale = null) { |
||
203 | } |
||
204 |