Example #1
0
 public function processForm(Form $form, $values)
 {
     if (!$this->authorizator->isAllowed($this->user, 'options', 'edit')) {
         $this->flashMessage('authorization.noPermission', FlashMessage::WARNING);
         $this->redirect('this');
     }
     try {
         $this->optionFacade->saveOptions((array) $values);
         $this->flashMessage('options.form.messages.success', FlashMessage::SUCCESS);
         $this->redirect('this');
     } catch (DBALException $e) {
         $form->addError($this->translator->translate('options.form.messages.savingError'));
     }
 }
Example #2
0
 protected function startup()
 {
     parent::startup();
     $this->userEntity = $this->user->getIdentity();
     $this->options = $this->optionFacade->loadOptions();
 }