<?phpnamespace App\Entity;use App\Repository\TelegramChatRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=TelegramChatRepository::class) */class TelegramChat{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $chatId; /** * @ORM\Column(type="text", nullable=true) */ private $title; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $type; /** * @ORM\ManyToMany(targetEntity=TelegramUser::class, mappedBy="administratesChats") */ private $administrators; public function __construct() { $this->administrators = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getChatId(): ?string { return $this->chatId; } public function setChatId(string $chatId): self { $this->chatId = $chatId; return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): self { $this->title = $title; return $this; } public function getType(): ?string { return $this->type; } public function setType(?string $type): self { $this->type = $type; return $this; } /** * @return Collection<int, TelegramUser> */ public function getAdministrators(): Collection { return $this->administrators; } public function addAdministrator(TelegramUser $administrator): self { if (!$this->administrators->contains($administrator)) { $this->administrators[] = $administrator; $administrator->addAdministratesChat($this); } return $this; } public function removeAdministrator(TelegramUser $administrator): self { if ($this->administrators->removeElement($administrator)) { $administrator->removeAdministratesChat($this); } return $this; }}