Stevemo\Cpanel\User\Form\UserForm::update PHP Метод

update() публичный Метод

Validate and update a existing user
Автор: Steve Montambeault
public update ( array $data ) : boolean
$data array
Результат boolean
    public function update(array $data)
    {
        try {
            if ($this->validator->with($data)->validForUpdate()) {
                $this->users->update($data['id'], $this->validator->getData());
                return true;
            }
        } catch (LoginRequiredException $e) {
            $this->validator->add('LoginRequiredException', $e->getMessage());
        } catch (PasswordRequiredException $e) {
            $this->validator->add('PasswordRequiredException', $e->getMessage());
        } catch (UserExistsException $e) {
            $this->validator->add('UserExistsException', $e->getMessage());
        }
        return false;
    }