public function updateAction() { $group = $this->groupTaskService->find($this->params('id')); if (!$group) { return $this->notFoundAction(); } $this->groupForm->bind($group); if ($this->getRequest()->isPost()) { $this->groupForm->setData($this->getRequest()->getPost()); if ($this->groupForm->isValid()) { $group = $this->groupForm->getData(); $this->groupTaskService->persist($group); $this->flashMessenger()->addSuccessMessage('The group has been updated.'); return $this->redirect()->toRoute('admin/usermanagement/groups'); } } return new ViewModel(['group' => $group, 'groupForm' => $this->groupForm]); }