/** * Processing form * @param Form $form * @param ArrayHash $values */ public function formSuccess($form, $values) { try { if ($this->project) { $this->project->update($values); } elseif ($this->gitlabId) { $this->projectRepository->insert(['gitlab_id' => $this->gitlabId, 'url' => $this->gitlabUrl, 'name' => $this->gitlabName, 'positive_votes' => $values['positive_votes'], 'delete_source_branch' => $values['delete_source_branch']]); } } catch (PDOException $e) { Debugger::log($e, Debugger::ERROR); $form->addError('Database error occurred'); return; } $this->onSuccess(); }