mirror of
https://github.com/openvk/openvk
synced 2024-12-28 03:14:06 +03:00
255d70e974
Signed-off-by: Celestora <kitsuruko@gmail.com>
19 lines
502 B
PHP
19 lines
502 B
PHP
<?php declare(strict_types=1);
|
|
namespace openvk\Web\Models\Repositories;
|
|
use openvk\Web\Models\Entities\Voucher;
|
|
|
|
class Vouchers extends Repository
|
|
{
|
|
protected $tableName = "coin_vouchers";
|
|
protected $modelName = "Voucher";
|
|
|
|
function getByToken(string $token, bool $withDeleted = false)
|
|
{
|
|
$voucher = $this->table->where([
|
|
"token" => $token,
|
|
"deleted" => $withDeleted,
|
|
])->fetch();
|
|
|
|
return $this->toEntity($voucher);
|
|
}
|
|
}
|