mirror of
https://github.com/openvk/openvk
synced 2024-11-14 19:19:14 +03:00
23 lines
485 B
PHP
23 lines
485 B
PHP
|
<?php declare(strict_types=1);
|
||
|
namespace openvk\Web\Models\Repositories;
|
||
|
use Chandler\Database\DatabaseConnection;
|
||
|
use openvk\Web\Models\Entities\Poll;
|
||
|
|
||
|
class Polls
|
||
|
{
|
||
|
private $polls;
|
||
|
|
||
|
function __construct()
|
||
|
{
|
||
|
$this->polls = DatabaseConnection::i()->getContext()->table("polls");
|
||
|
}
|
||
|
|
||
|
function get(int $id): ?Poll
|
||
|
{
|
||
|
$poll = $this->polls->get($id);
|
||
|
if(!$poll)
|
||
|
return NULL;
|
||
|
|
||
|
return new Poll($poll);
|
||
|
}
|
||
|
}
|