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>
33 lines
No EOL
765 B
PHP
33 lines
No EOL
765 B
PHP
<?php declare(strict_types=1);
|
|
namespace openvk\Web\Models\Repositories;
|
|
use Chandler\Database\DatabaseConnection as DB;
|
|
use Nette\Database\Table\{ActiveRow, Selection};
|
|
use openvk\Web\Models\Entities\Ban;
|
|
|
|
class Bans
|
|
{
|
|
private $context;
|
|
private $bans;
|
|
|
|
function __construct()
|
|
{
|
|
$this->context = DB::i()->getContext();
|
|
$this->bans = $this->context->table("bans");
|
|
}
|
|
|
|
function toBan(?ActiveRow $ar): ?Ban
|
|
{
|
|
return is_null($ar) ? NULL : new Ban($ar);
|
|
}
|
|
|
|
function get(int $id): ?Ban
|
|
{
|
|
return $this->toBan($this->bans->get($id));
|
|
}
|
|
|
|
function getByUser(int $user_id): \Traversable
|
|
{
|
|
foreach ($this->bans->where("user", $user_id) as $ban)
|
|
yield new Ban($ban);
|
|
}
|
|
} |