src/Brick/User/UserManager.php
public function edit($id = 0, $data = [])
	{
		$change = [];

		if (isset($data['email'])) {
			$change['email'] = $data['email'];
		}

		if (isset($data['role'])) {
			$change['role'] = $data['role'];
		}

		if (isset($data['username'])) {
			$change['username'] = Strings::webalize($data['username']);
		}

		if (isset($data['password']) && $data['password'] !== '') {
			$change['password'] = Passwords::hash($data['password']);
		}

		if (isset($data['name'])) {
			$change['name'] = $data['name'];
		}

		if ($this->isImage() && isset($data['avatar_namespace']) && isset($data['avatar_filename'])) {
			$change['avatar_namespace'] = $data['avatar_namespace'];
			$change['avatar_filename'] = $data['avatar_filename'];
		}

		$this->repository->update($id, $change);

		return $this->get($id);
	}
public function edit($id = 0, $data = [])
	{
		$change = [];

		if (isset($data['email'])) {
			$change['email'] = $data['email'];
		}

		if (isset($data['role'])) {
			$change['role'] = $data['role'];
		}

		if (isset($data['username'])) {
			$change['username'] = Strings::webalize($data['username']);
		}

		if (isset($data['password']) && $data['password'] !== '') {
			$change['password'] = Passwords::hash($data['password']);
		}

		if (isset($data['name'])) {
			$change['name'] = $data['name'];
		}

		if ($this->isImage() && isset($data['avatar_namespace']) && isset($data['avatar_filename'])) {
			$change['avatar_namespace'] = $data['avatar_namespace'];
			$change['avatar_filename'] = $data['avatar_filename'];
		}

		$this->repository->update($id, $change);

		return $this->get($id);
	}
@param int $id
@param array $data

@return Nette\Database\Table\ActiveRow