mirror of
https://github.com/openvk/openvk
synced 2024-12-23 17:12:01 +03:00
20 lines
502 B
PHP
20 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);
|
||
|
}
|
||
|
}
|