1 | <?php |
||
36 | abstract class AbstractController extends Controller { |
||
37 | |||
38 | /** |
||
39 | * Get the container. |
||
40 | * |
||
41 | * @return Container Returns the container. |
||
42 | */ |
||
43 | protected function getContainer() { |
||
46 | |||
47 | /** |
||
48 | * Get the event dispatcher. |
||
49 | * |
||
50 | * @return EventDispatcherInterface Returns the event dispatcher. |
||
51 | */ |
||
52 | protected function getEventDispatcher() { |
||
55 | |||
56 | /** |
||
57 | * Get the kernel event listener. |
||
58 | * |
||
59 | * @return KernelEventListener Returns the kernel event listener. |
||
60 | */ |
||
61 | protected function getKernelEventListener() { |
||
64 | |||
65 | /** |
||
66 | * Get the logger. |
||
67 | * |
||
68 | * @return LoggerInterface Returns the logger. |
||
69 | */ |
||
70 | protected function getLogger() { |
||
73 | |||
74 | /** |
||
75 | * Get the router. |
||
76 | * |
||
77 | * @return RouterInterface Returns the router. |
||
78 | */ |
||
79 | protected function getRouter() { |
||
82 | |||
83 | /** |
||
84 | * Get the session. |
||
85 | * |
||
86 | * @return SessionInterface Returns the session. |
||
87 | */ |
||
88 | protected function getSession() { |
||
91 | |||
92 | /** |
||
93 | * Get the translator. |
||
94 | * |
||
95 | * @return TranslatorInterface Returns the translator. |
||
96 | */ |
||
97 | protected function getTranslator() { |
||
100 | |||
101 | /** |
||
102 | * Determines if the connected user have roles or redirect. |
||
103 | * |
||
104 | * @param array $roles The roles. |
||
105 | * @param bool $or OR ? |
||
106 | * @param string $redirectUrl The redirect URL. |
||
107 | * @param string $originUrl The origin URL. |
||
108 | * @return bool Returns true. |
||
109 | * @throws BadUserRoleException Throws a bad user role exception. |
||
110 | */ |
||
111 | protected function hasRolesOrRedirect(array $roles, $or, $redirectUrl, $originUrl = "") { |
||
127 | |||
128 | /** |
||
129 | * Notify. |
||
130 | * |
||
131 | * @param string $eventName The event name. |
||
132 | * @param NotificationInterface $notification The notification. |
||
133 | * @return Event Returns the event. |
||
134 | */ |
||
135 | protected function notify($eventName, NotificationInterface $notification) { |
||
149 | |||
150 | } |
||
151 |