2014-08-30 18:11:32 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Dao;
|
|
|
|
|
|
|
|
class TokenDao extends AbstractDao
|
|
|
|
{
|
|
|
|
public function __construct(\Szurubooru\DatabaseConnection $databaseConnection)
|
|
|
|
{
|
|
|
|
parent::__construct($databaseConnection, 'tokens', '\Szurubooru\Entities\Token');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getByName($tokenName)
|
|
|
|
{
|
|
|
|
$arrayEntity = $this->collection->findOne(['name' => $tokenName]);
|
|
|
|
return $this->entityConverter->toEntity($arrayEntity);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function deleteByName($tokenName)
|
|
|
|
{
|
|
|
|
$this->collection->remove(['name' => $tokenName]);
|
|
|
|
}
|
2014-09-05 09:37:53 +02:00
|
|
|
|
|
|
|
public function deleteByAdditionalData($additionalData)
|
|
|
|
{
|
|
|
|
$this->collection->remove(['additionalData' => $additionalData]);
|
|
|
|
}
|
2014-08-30 18:11:32 +02:00
|
|
|
}
|