2014-08-31 09:03:11 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Services;
|
|
|
|
|
|
|
|
class UserService
|
|
|
|
{
|
|
|
|
private $userDao;
|
|
|
|
|
|
|
|
public function __construct(\Szurubooru\Dao\UserDao $userDao)
|
|
|
|
{
|
|
|
|
$this->userDao = $userDao;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getById($userId)
|
|
|
|
{
|
|
|
|
return $this->userDao->getById($userId);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getByName($userName)
|
|
|
|
{
|
|
|
|
return $this->userDao->getByName($userName);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function save($user)
|
|
|
|
{
|
|
|
|
return $this->userDao->save($user);
|
|
|
|
}
|
2014-08-31 13:16:29 +02:00
|
|
|
|
|
|
|
public function getAnonymousUser()
|
|
|
|
{
|
|
|
|
$user = new \Szurubooru\Entities\User();
|
|
|
|
$user->name = 'Anonymous user';
|
|
|
|
$user->accessRank = \Szurubooru\Entities\User::ACCESS_RANK_ANONYMOUS;
|
|
|
|
}
|
2014-08-31 09:03:11 +02:00
|
|
|
}
|