2025-01-31 18:20:13 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-06-07 19:04:43 +03:00
|
|
|
namespace openvk\Web\Models\Entities;
|
2025-01-31 18:20:13 +03:00
|
|
|
|
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
|
|
|
|
{
|
2025-01-31 18:20:13 +03:00
|
|
|
use Traits\TSubscribable;
|
2020-06-07 19:04:43 +03:00
|
|
|
protected $tableName = "group_coadmins";
|
2025-01-31 18:20:13 +03:00
|
|
|
|
|
|
|
public function getId(): int
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
return $this->getRecord()->id;
|
|
|
|
}
|
2025-01-31 18:20:13 +03:00
|
|
|
|
|
|
|
public function getUserId(): int
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
return $this->getRecord()->user;
|
|
|
|
}
|
|
|
|
|
2025-01-31 18:20:13 +03:00
|
|
|
public function getUser(): ?User
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
2025-01-31 18:20:13 +03:00
|
|
|
return (new Users())->get($this->getRecord()->user);
|
2020-06-07 19:04:43 +03:00
|
|
|
}
|
|
|
|
|
2025-01-31 18:20:13 +03:00
|
|
|
public function getClubId(): int
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
return $this->getRecord()->club;
|
|
|
|
}
|
|
|
|
|
2025-01-31 18:20:13 +03:00
|
|
|
public function getClub(): ?Club
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
2025-01-31 18:20:13 +03:00
|
|
|
return (new Clubs())->get($this->getRecord()->club);
|
2020-06-07 19:04:43 +03:00
|
|
|
}
|
|
|
|
|
2025-01-31 18:20:13 +03:00
|
|
|
public function getComment(): string
|
2020-06-07 19:04:43 +03:00
|
|
|
{
|
|
|
|
return is_null($this->getRecord()->comment) ? "" : $this->getRecord()->comment;
|
|
|
|
}
|
2021-11-10 11:45:06 +03:00
|
|
|
|
2025-01-31 18:20:13 +03:00
|
|
|
public function isHidden(): bool
|
2021-11-12 16:31:23 +03:00
|
|
|
{
|
|
|
|
return (bool) $this->getRecord()->hidden;
|
|
|
|
}
|
|
|
|
|
2025-01-31 18:20:13 +03:00
|
|
|
public function isClubPinned(): bool
|
2021-11-10 11:45:06 +03:00
|
|
|
{
|
|
|
|
return (bool) $this->getRecord()->club_pinned;
|
|
|
|
}
|
2020-06-07 19:04:43 +03:00
|
|
|
}
|