src/Entity/TelegramBot.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TelegramBotRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TelegramBotRepository::class)
  9.  */
  10. class TelegramBot
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=500)
  20.      */
  21.     private $innerBotId;
  22.     /**
  23.      * @ORM\ManyToMany(targetEntity=TelegramChat::class)
  24.      */
  25.     private $groups;
  26.     public function __construct()
  27.     {
  28.         $this->groups = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getInnerBotId(): ?string
  35.     {
  36.         return $this->innerBotId;
  37.     }
  38.     public function setInnerBotId(string $innerBotId): self
  39.     {
  40.         $this->innerBotId $innerBotId;
  41.         return $this;
  42.     }
  43.     /**
  44.      * @return Collection<int, TelegramChat>
  45.      */
  46.     public function getGroups(): Collection
  47.     {
  48.         return $this->groups;
  49.     }
  50.     public function addGroup(TelegramChat $group): self
  51.     {
  52.         if (!$this->groups->contains($group)) {
  53.             $this->groups[] = $group;
  54.         }
  55.         return $this;
  56.     }
  57.     public function removeGroup(TelegramChat $group): self
  58.     {
  59.         $this->groups->removeElement($group);
  60.         return $this;
  61.     }
  62. }