public function invokeAction()
{
$request = $this->request;
if (!isset($request)) {
throw new \LogicException('No Request object configured. Cannot invoke action');
}
if (!$this->isAction($request->params['action'])) {
throw new MissingActionException(['controller' => $this->name . 'Controller', 'action' => $request->params['action'], 'prefix' => isset($request->params['prefix']) ? $request->params['prefix'] : '', 'plugin' => $request->params['plugin']]);
}
$callable = [$this, $request->params['action']];
if (is_callable($callable)) {
return call_user_func_array($callable, $request->params['pass']);
}
$component = $this->_isActionMapped();
if ($component) {
return $component->execute();
}
throw new MissingActionException(['controller' => $this->name . 'Controller', 'action' => $request->params['action'], 'prefix' => isset($request->params['prefix']) ? $request->params['prefix'] : '', 'plugin' => $request->params['plugin']]);
}