1 | <?php |
||
38 | abstract class AbstractModuleController extends ActionController implements AdministrationModuleInterface |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * Module name, used to identify a module f.e. in URL parameters. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $moduleName = ''; |
||
47 | |||
48 | /** |
||
49 | * Module title, shows up in the module menu. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $moduleTitle = ''; |
||
54 | |||
55 | /** |
||
56 | * @var \ApacheSolrForTypo3\Solr\Service\ModuleDataStorageService |
||
57 | * @inject |
||
58 | */ |
||
59 | protected $moduleDataStorageService; |
||
60 | |||
61 | /** |
||
62 | * Extension key |
||
63 | * |
||
64 | * @var string |
||
65 | */ |
||
66 | protected $extensionKey = ''; |
||
67 | |||
68 | /** |
||
69 | * @var \ApacheSolrForTypo3\Solr\ConnectionManager |
||
70 | * @inject |
||
71 | */ |
||
72 | protected $connectionManager = null; |
||
73 | |||
74 | /** |
||
75 | * The currently selected Site. |
||
76 | * |
||
77 | * @var Site |
||
78 | */ |
||
79 | protected $site; |
||
80 | |||
81 | /** |
||
82 | * @var \ApacheSolrForTypo3\Solr\Utility\StringUtility |
||
83 | */ |
||
84 | protected $stringUtility; |
||
85 | |||
86 | /** |
||
87 | * Gets the module name. |
||
88 | * |
||
89 | * @return string Module name |
||
90 | */ |
||
91 | public function getName() |
||
95 | |||
96 | /** |
||
97 | * Gets the module title. |
||
98 | * |
||
99 | * @return string Module title |
||
100 | */ |
||
101 | public function getTitle() |
||
105 | |||
106 | /** |
||
107 | * Sets the extension key |
||
108 | * |
||
109 | * @param string $extensionKey Extension key |
||
110 | */ |
||
111 | public function setExtensionKey($extensionKey) |
||
115 | |||
116 | /** |
||
117 | * Gets the extension key |
||
118 | * |
||
119 | * @return string Extension key |
||
120 | */ |
||
121 | public function getExtensionKey() |
||
125 | |||
126 | /** |
||
127 | * Method to pass a StringUtil object. |
||
128 | * Use to overwrite injected object in unit test context. |
||
129 | * |
||
130 | * @param \ApacheSolrForTypo3\Solr\Utility\StringUtility $stringUtility |
||
131 | */ |
||
132 | public function injectStringHelper(StringUtility $stringUtility) |
||
136 | |||
137 | /** |
||
138 | * Initializes resources commonly needed for several actions |
||
139 | * |
||
140 | * @return void |
||
141 | */ |
||
142 | protected function initializeAction() |
||
167 | |||
168 | /** |
||
169 | * Return Fallback site |
||
170 | * |
||
171 | * @return Site |
||
172 | */ |
||
173 | protected function getFallbackSite() |
||
180 | |||
181 | /** |
||
182 | * Initializes the view before invoking an action method. |
||
183 | * |
||
184 | * Assigns the current module to the view |
||
185 | * |
||
186 | * @param \TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view The view to be initialized |
||
187 | * @return void |
||
188 | */ |
||
189 | protected function initializeView(ViewInterface $view) |
||
193 | |||
194 | /** |
||
195 | * Checks if the request argument is present an returns it. If not it returns the default value. |
||
196 | * |
||
197 | * @param string $argumentKey |
||
198 | * @param mixed $default |
||
199 | * @return mixed |
||
200 | */ |
||
201 | protected function getRequestArgumentOrDefaultValue($argumentKey, $default) |
||
215 | |||
216 | /** |
||
217 | * Forwards to the index action after resetting module and moduleAction |
||
218 | * arguments to prevent execution of module actions. |
||
219 | * |
||
220 | * @return void |
||
221 | */ |
||
222 | protected function forwardToIndex() |
||
240 | |||
241 | /** |
||
242 | * Finds the Solr connection to use for the currently selected core. |
||
243 | * |
||
244 | * @return \ApacheSolrForTypo3\Solr\SolrService Solr connection |
||
245 | */ |
||
246 | protected function getSelectedCoreSolrConnection() |
||
268 | |||
269 | /** |
||
270 | * Adds flash massages from another flash message queue, e.g. solr.queue.initializer |
||
271 | * |
||
272 | * @param string $identifier |
||
273 | * @return void |
||
274 | */ |
||
275 | protected function addFlashMessagesByQueueIdentifier($identifier) |
||
282 | } |
||
283 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: