<?php
namespace App\Entity;
use App\Repository\TelegramBotRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TelegramBotRepository::class)
*/
class TelegramBot
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=500)
*/
private $innerBotId;
/**
* @ORM\ManyToMany(targetEntity=TelegramChat::class)
*/
private $groups;
public function __construct()
{
$this->groups = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getInnerBotId(): ?string
{
return $this->innerBotId;
}
public function setInnerBotId(string $innerBotId): self
{
$this->innerBotId = $innerBotId;
return $this;
}
/**
* @return Collection<int, TelegramChat>
*/
public function getGroups(): Collection
{
return $this->groups;
}
public function addGroup(TelegramChat $group): self
{
if (!$this->groups->contains($group)) {
$this->groups[] = $group;
}
return $this;
}
public function removeGroup(TelegramChat $group): self
{
$this->groups->removeElement($group);
return $this;
}
}