openvk/Web/Models/Entities/BugReportComment.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2022-08-20 20:30:04 +03:00
<?php declare(strict_types=1);
namespace openvk\Web\Models\Entities;
2022-08-22 02:11:48 +03:00
use openvk\Web\Util\DateTime;
2022-08-20 20:30:04 +03:00
use openvk\Web\Models\{RowModel};
use openvk\Web\Models\Entities\{User, BugtrackerProduct};
use openvk\Web\Models\Repositories\{Users, BugtrackerProducts};
use Chandler\Database\DatabaseConnection as DB;
class BugReportComment extends RowModel
{
protected $tableName = "bt_comments";
function getId(): int
{
return $this->getRecord()->id;
}
function getAuthor(): ?User
{
return (new Users)->get($this->getRecord()->author);
}
function isModer(): bool
{
return (bool) $this->getRecord()->is_moder;
}
function isHidden(): bool
{
return (bool) $this->getRecord()->is_hidden;
}
function getText(): string
{
return $this->getRecord()->text;
}
function getLabel(): string
{
return $this->getRecord()->label;
}
2022-08-21 23:30:25 +03:00
function getBalanceChanges(): ?int
{
return $this->getRecord()->point_actions;
}
2022-08-22 02:11:48 +03:00
function getCreationTime(): DateTime
{
return new DateTime($this->getRecord()->created);
}
2022-08-20 20:30:04 +03:00
}