public function editFormSucceeded(Form $form, ArrayHash $values): void
	{
		try {
			$this->currentUser->setUsername($values->username);
		} catch (UniqueConstraintViolationException $ex) {
			$form->addError('cms.user.duplicityUsername');
			return;
		} catch (InvalidArgumentException $ex) {
			$form->addError('cms.user.invalidUsername');
			return;
		}

		try {
			$this->currentUser->setEmail($values->email);
		} catch (UniqueConstraintViolationException $ex) {
			$form->addError('cms.user.duplicityEmail');
			return;
		} catch (InvalidArgumentException $ex) {
			$form->addError('cms.user.invalidUsername');
			return;
		}

		try {
			$this->currentUser->setPhone($values->phone ?: null);
		} catch (InvalidArgumentException $ex) {
			$form->addError('cms.user.invalidPhone');
			return;
		}

		$this->currentUser->firstName = $values->firstName;
		$this->currentUser->surname = $values->surname;
		$this->currentUser->roles->set($values->roles);

		$language = $this->localeService->getById($values->language);
		$this->currentUser->language = $language === null ? null : $language->name;

		$this->orm->persistAndFlush($this->currentUser);

		$this->flashNotifier->success('cms.user.dataSaved');
		$this->restoreBacklink();
	}
public function editFormSucceeded(Form $form, ArrayHash $values): void
	{
		try {
			$this->currentUser->setUsername($values->username);
		} catch (UniqueConstraintViolationException $ex) {
			$form->addError('cms.user.duplicityUsername');
			return;
		} catch (InvalidArgumentException $ex) {
			$form->addError('cms.user.invalidUsername');
			return;
		}

		try {
			$this->currentUser->setEmail($values->email);
		} catch (UniqueConstraintViolationException $ex) {
			$form->addError('cms.user.duplicityEmail');
			return;
		} catch (InvalidArgumentException $ex) {
			$form->addError('cms.user.invalidUsername');
			return;
		}

		try {
			$this->currentUser->setPhone($values->phone ?: null);
		} catch (InvalidArgumentException $ex) {
			$form->addError('cms.user.invalidPhone');
			return;
		}

		$this->currentUser->firstName = $values->firstName;
		$this->currentUser->surname = $values->surname;
		$this->currentUser->roles->set($values->roles);

		$language = $this->localeService->getById($values->language);
		$this->currentUser->language = $language === null ? null : $language->name;

		$this->orm->persistAndFlush($this->currentUser);

		$this->flashNotifier->success('cms.user.dataSaved');
		$this->restoreBacklink();
	}
public function editFormSucceeded ( Form $ form , ArrayHash $ values ) : void { try { $ this -> currentUser -> setUsername ( $ values -> username ) ; } catch ( UniqueConstraintViolationException $ ex ) { $ form -> addError ( 'cms.user.duplicityUsername' ) ; return ; } catch ( InvalidArgumentException $ ex ) { $ form -> addError ( 'cms.user.invalidUsername' ) ; return ; } try { $ this -> currentUser -> setEmail ( $ values -> email ) ; } catch ( UniqueConstraintViolationException $ ex ) { $ form -> addError ( 'cms.user.duplicityEmail' ) ; return ; } catch ( InvalidArgumentException $ ex ) { $ form -> addError ( 'cms.user.invalidUsername' ) ; return ; } try { $ this -> currentUser -> setPhone ( $ values -> phone ? : null ) ; } catch ( InvalidArgumentException $ ex ) { $ form -> addError ( 'cms.user.invalidPhone' ) ; return ; } $ this -> currentUser -> firstName = $ values -> firstName ; $ this -> currentUser -> surname = $ values -> surname ; $ this -> currentUser -> roles -> set ( $ values -> roles ) ; $ language = $ this -> localeService -> getById ( $ values -> language ) ; $ this -> currentUser -> language = $ language === null ? null : $ language -> name ; $ this -> orm -> persistAndFlush ( $ this -> currentUser ) ; $ this -> flashNotifier -> success ( 'cms.user.dataSaved' ) ; $ this -> restoreBacklink ( ) ; }
Zpracovani editace uzivatele
@param Form $form
@param ArrayHash $values
Zpracovani editace uzivatele