mirror of
https://github.com/openvk/openvk
synced 2024-11-14 19:19:14 +03:00
6159262026
* Reports: [INDEV] Undone implementation of reports
* Reports: Backend is done
* Reports: Still makin it...
* Reports: Added report window
* Reports: Corrected the content type
* Reports: Make it work
* Reports: Minor fixes and localization
* Reports: Ability to hide Share and Like buttons
Also renamed the .sql file
* Revent some changes from 8f8d7bb
I will move them to the master branch
* Reports: Only for those who can access Helpdesk
* Reports: Modified the route
* Reports: Change the routes
* Reports: Show reports count
* Report: Fix URL
* Обновление репортов (#715)
* Репорты живы
* 2
* Better reports
* Логи
* Update DBEntity.updated.php
* noSpam
* Сбор IP и UserAgent + фикс логирования в IPs
* Новые поля для поиска etc.
* Fixes
* Fixes and enhancements
* Поиск по нескольким разделам
* Reports enhancements
* Совместимость с новыми логами
* Совместимость с новыми логами
* Update Logs.xml
* Update Logs.xml
* Logs i18n
* Update Logs.xml
* Update AdminPresenter.php
---------
Co-authored-by: veselcraft <veselcraft@icloud.com>
Co-authored-by: Ilya Prokopenko <55238545+Xenforce@users.noreply.github.com>
Co-authored-by: n1rwana <aydashkin@vk.com>
66 lines
1.3 KiB
PHP
66 lines
1.3 KiB
PHP
<?php declare(strict_types=1);
|
|
namespace openvk\Web\Models\Entities;
|
|
use openvk\Web\Models\RowModel;
|
|
use openvk\Web\Util\DateTime;
|
|
use openvk\Web\Models\Repositories\{Users};
|
|
use Nette\Database\Table\ActiveRow;
|
|
|
|
class Ban extends RowModel
|
|
{
|
|
protected $tableName = "bans";
|
|
|
|
function getId(): int
|
|
{
|
|
return $this->getRecord()->id;
|
|
}
|
|
|
|
function getReason(): ?string
|
|
{
|
|
return $this->getRecord()->reason;
|
|
}
|
|
|
|
function getUser(): ?User
|
|
{
|
|
return (new Users)->get($this->getRecord()->user);
|
|
}
|
|
|
|
function getInitiator(): ?User
|
|
{
|
|
return (new Users)->get($this->getRecord()->initiator);
|
|
}
|
|
|
|
function getStartTime(): int
|
|
{
|
|
return $this->getRecord()->iat;
|
|
}
|
|
|
|
function getEndTime(): int
|
|
{
|
|
return $this->getRecord()->exp;
|
|
}
|
|
|
|
function getTime(): int
|
|
{
|
|
return $this->getRecord()->time;
|
|
}
|
|
|
|
function isPermanent(): bool
|
|
{
|
|
return $this->getEndTime() === 0;
|
|
}
|
|
|
|
function isRemovedManually(): bool
|
|
{
|
|
return (bool) $this->getRecord()->removed_manually;
|
|
}
|
|
|
|
function isOver(): bool
|
|
{
|
|
return $this->isRemovedManually();
|
|
}
|
|
|
|
function whoRemoved(): ?User
|
|
{
|
|
return (new Users)->get($this->getRecord()->removed_by);
|
|
}
|
|
}
|