Added TokenService and UserService
This commit is contained in:
parent
45e32c4e50
commit
18d9c21435
2 changed files with 59 additions and 0 deletions
32
src/Services/TokenService.php
Normal file
32
src/Services/TokenService.php
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
namespace Szurubooru\Services;
|
||||
|
||||
class TokenService
|
||||
{
|
||||
private $tokenDao;
|
||||
|
||||
public function __construct(\Szurubooru\Dao\TokenDao $tokenDao)
|
||||
{
|
||||
$this->tokenDao = $tokenDao;
|
||||
}
|
||||
|
||||
public function getById($tokenId)
|
||||
{
|
||||
return $this->tokenDao->getById($tokenId);
|
||||
}
|
||||
|
||||
public function getByName($tokenName)
|
||||
{
|
||||
return $this->tokenDao->getByName($tokenName);
|
||||
}
|
||||
|
||||
public function deleteByName($tokenName)
|
||||
{
|
||||
return $this->tokenDao->deleteByName($tokenName);
|
||||
}
|
||||
|
||||
public function save($token)
|
||||
{
|
||||
return $this->tokenDao->save($token);
|
||||
}
|
||||
}
|
27
src/Services/UserService.php
Normal file
27
src/Services/UserService.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue