openvk/Web/Models/Entities/Manager.php

60 lines
1.3 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
2020-06-07 19:04:43 +03:00
namespace openvk\Web\Models\Entities;
2020-06-07 19:04:43 +03:00
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;
2020-06-07 19:04:43 +03:00
protected $tableName = "group_coadmins";
public function getId(): int
2020-06-07 19:04:43 +03:00
{
return $this->getRecord()->id;
}
public function getUserId(): int
2020-06-07 19:04:43 +03:00
{
return $this->getRecord()->user;
}
public function getUser(): ?User
2020-06-07 19:04:43 +03:00
{
return (new Users())->get($this->getRecord()->user);
2020-06-07 19:04:43 +03:00
}
public function getClubId(): int
2020-06-07 19:04:43 +03:00
{
return $this->getRecord()->club;
}
public function getClub(): ?Club
2020-06-07 19:04:43 +03:00
{
return (new Clubs())->get($this->getRecord()->club);
2020-06-07 19:04:43 +03:00
}
public function getComment(): string
2020-06-07 19:04:43 +03:00
{
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;
}
2020-06-07 19:04:43 +03:00
}