mirror of
https://github.com/openvk/openvk
synced 2025-04-20 23:23:05 +03:00
28 lines
500 B
PHP
28 lines
500 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;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->polls = DatabaseConnection::i()->getContext()->table("polls");
|
|
}
|
|
|
|
public function get(int $id): ?Poll
|
|
{
|
|
$poll = $this->polls->get($id);
|
|
if (!$poll) {
|
|
return null;
|
|
}
|
|
|
|
return new Poll($poll);
|
|
}
|
|
}
|