2014-08-30 18:11:32 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Dao;
|
|
|
|
|
|
|
|
class TokenDao extends AbstractDao
|
|
|
|
{
|
|
|
|
public function __construct(\Szurubooru\DatabaseConnection $databaseConnection)
|
|
|
|
{
|
2014-09-15 09:25:11 +02:00
|
|
|
parent::__construct(
|
|
|
|
$databaseConnection,
|
|
|
|
'tokens',
|
|
|
|
new \Szurubooru\Dao\EntityConverters\TokenEntityConverter());
|
2014-08-30 18:11:32 +02:00
|
|
|
}
|
|
|
|
|
2014-09-13 23:58:13 +02:00
|
|
|
public function findByName($tokenName)
|
2014-08-30 18:11:32 +02:00
|
|
|
{
|
2014-09-14 16:16:15 +02:00
|
|
|
return $this->findOneBy('name', $tokenName);
|
2014-08-30 18:11:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function deleteByName($tokenName)
|
|
|
|
{
|
2014-09-14 16:16:15 +02:00
|
|
|
return $this->deleteBy('name', $tokenName);
|
2014-08-30 18:11:32 +02:00
|
|
|
}
|
2014-09-05 09:37:53 +02:00
|
|
|
|
|
|
|
public function deleteByAdditionalData($additionalData)
|
|
|
|
{
|
2014-09-14 16:16:15 +02:00
|
|
|
return $this->deleteBy('additionalData', $additionalData);
|
2014-09-05 09:37:53 +02:00
|
|
|
}
|
2014-08-30 18:11:32 +02:00
|
|
|
}
|