Added TokenService and UserService

This commit is contained in:
Marcin Kurczewski 2014-08-31 09:03:11 +02:00
parent 45e32c4e50
commit 18d9c21435
2 changed files with 59 additions and 0 deletions

View 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);
}
}

View 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);
}
}