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.
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Created by Error202
|
|
|
|
* Date: 22.08.2017
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace core\services\user;
|
|
|
|
|
|
|
|
use core\repositories\user\UserRepository;
|
|
|
|
use core\forms\user\ProfileEditForm;
|
|
|
|
|
|
|
|
class ProfileService
|
|
|
|
{
|
|
|
|
private $users;
|
|
|
|
|
|
|
|
public function __construct(UserRepository $users)
|
|
|
|
{
|
|
|
|
$this->users = $users;
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
$this->users->save($user);
|
|
|
|
}
|
|
|
|
}
|