public function __invoke(Update $updater) { $redirect = null; if ($updater->getValid()) { if ($updater->getUseSessionMessage()) { $this->flashMessenger()->addSuccessMessage($updater->getFormattedSuccessMessage()); } $redirect = $this->url()->fromRoute($updater->getSuccessRedirectRouteName(), $updater->getSuccessRedirectRouteParams(), $updater->getSuccessRedirectRouteOptions()); } else { // set error /* @var $response \Zend\Http\PhpEnvironment\Response */ $response = $this->getService('Response'); $response->setStatusCode(Response::STATUS_CODE_400); } return array('success' => $updater->getValid(), 'messages' => $updater->getErrorMessages(), 'models' => $updater->getEntitiesAsJson(), 'redirect' => $redirect); }
protected function update(Params $params, UpdateService $updateService) { $updateService->update($params); return new JsonModel($this->fzyUpdateResult($updateService)); }
public function reset() { $this->formMap = array(); return parent::reset(); }