You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
713 B

7 years ago
<?php
/**
* Created by Error202
* Date: 22.08.2017
*/
namespace core\services\user;
use core\repositories\user\UserRepository;
use core\forms\user\ProfileEditForm;
3 years ago
use yii\base\Exception;
7 years ago
class ProfileService
{
3 years ago
private UserRepository $users;
7 years ago
public function __construct(UserRepository $users)
{
$this->users = $users;
}
3 years ago
/**
* @param $id
* @param ProfileEditForm $form
* @throws Exception
*/
7 years ago
public function edit($id, ProfileEditForm $form): void
{
$user = $this->users->get($id);
$user->editProfile($form->email, $form->username, $form->password, $form->user_pic, $form->backend_language);
7 years ago
$this->users->save($user);
}
3 years ago
}