2020-06-07 19:04:43 +03:00
|
|
|
<?php declare(strict_types=1);
|
|
|
|
namespace openvk\Web\Models\Entities;
|
|
|
|
use openvk\Web\Util\DateTime;
|
|
|
|
use openvk\Web\Models\RowModel;
|
|
|
|
use openvk\Web\Models\Entities\{Photo, Message, Correspondence};
|
|
|
|
use openvk\Web\Models\Repositories\{Users, Clubs, Albums, Notifications, Managers};
|
|
|
|
use Nette\Database\Table\ActiveRow;
|
|
|
|
use Chandler\Database\DatabaseConnection;
|
|
|
|
use Chandler\Security\User as ChandlerUser;
|
|
|
|
|
|
|
|
class Manager extends RowModel
|
|
|
|
{
|
|
|
|
protected $tableName = "group_coadmins";
|
|
|
|
|
|
|
|
function getId(): int
|
|
|
|
{
|
|
|
|
return $this->getRecord()->id;
|
|
|
|
}
|
|
|
|
|
2021-11-06 14:06:57 +03:00
|
|
|
function getUserId(): int
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
return $this->getRecord()->user;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getUser(): ?User
|
|
|
|
{
|
|
|
|
return (new Users)->get($this->getRecord()->user);
|
|
|
|
}
|
|
|
|
|
2021-11-06 14:06:57 +03:00
|
|
|
function getClubId(): int
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
return $this->getRecord()->club;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getClub(): ?Club
|
|
|
|
{
|
|
|
|
return (new Clubs)->get($this->getRecord()->club);
|
|
|
|
}
|
|
|
|
|
|
|
|
function getComment(): string
|
|
|
|
{
|
|
|
|
return is_null($this->getRecord()->comment) ? "" : $this->getRecord()->comment;
|
|
|
|
}
|
2021-11-10 11:45:06 +03:00
|
|
|
|
2021-11-12 16:31:23 +03:00
|
|
|
function isHidden(): bool
|
|
|
|
{
|
|
|
|
return (bool) $this->getRecord()->hidden;
|
|
|
|
}
|
|
|
|
|
2021-11-10 11:45:06 +03:00
|
|
|
function isClubPinned(): bool
|
|
|
|
{
|
|
|
|
return (bool) $this->getRecord()->club_pinned;
|
|
|
|
}
|
2020-06-07 19:04:43 +03:00
|
|
|
|
|
|
|
use Traits\TSubscribable;
|
|
|
|
}
|