mirror of
https://github.com/openvk/openvk
synced 2025-02-02 13:05:37 +03:00
Alexander Minkin
6ec54a379d
* feat(lint): add php-cs-fixer for linting Removing previous CODE_STYLE as it was not enforced anyway and using PER-CS 2.0. This is not the reformatting commit. * style: format code according to PER-CS 2.0 with php-cs-fixer * ci(actions): add lint action Resolves #1132.
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?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
|
|
{
|
|
use Traits\TSubscribable;
|
|
protected $tableName = "group_coadmins";
|
|
|
|
public function getId(): int
|
|
{
|
|
return $this->getRecord()->id;
|
|
}
|
|
|
|
public function getUserId(): int
|
|
{
|
|
return $this->getRecord()->user;
|
|
}
|
|
|
|
public function getUser(): ?User
|
|
{
|
|
return (new Users())->get($this->getRecord()->user);
|
|
}
|
|
|
|
public function getClubId(): int
|
|
{
|
|
return $this->getRecord()->club;
|
|
}
|
|
|
|
public function getClub(): ?Club
|
|
{
|
|
return (new Clubs())->get($this->getRecord()->club);
|
|
}
|
|
|
|
public function getComment(): string
|
|
{
|
|
return is_null($this->getRecord()->comment) ? "" : $this->getRecord()->comment;
|
|
}
|
|
|
|
public function isHidden(): bool
|
|
{
|
|
return (bool) $this->getRecord()->hidden;
|
|
}
|
|
|
|
public function isClubPinned(): bool
|
|
{
|
|
return (bool) $this->getRecord()->club_pinned;
|
|
}
|
|
}
|