src/Entity/Bot.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BotRepository;
  4. use App\Trait\ArrayableTrait;
  5. use App\Trait\DateTrait;
  6. use DateTimeImmutable;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassBotRepository::class)]
  10. class Bot
  11. {
  12.     use DateTrait;
  13.     use ArrayableTrait;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $name null;
  20.     #[ORM\Column]
  21.     private ?bool $isActif null;
  22.     #[ORM\Column(length255nullabletrue)]
  23.     private ?string $token_telegram null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $description null;
  26.     #[ORM\ManyToOne(inversedBy'bots')]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?Establishment $establishment null;
  29.     #[ORM\Column(typeTypes::JSONnullabletrue)]
  30.     private ?array $config = [];
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $introMessage null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $chatServer null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $title null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $mainColor "#ec5b2f";
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $bubbleBackground "#ec5b2f";
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $placeholderText "Envoyer un message";
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $aboutLink'https://kimia.pro';
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $aboutText 'Kimia Mananger';
  47.     #[ORM\ManyToOne(cascade: ['persist'])]
  48.     private ?Attachment $bubbleAvatarUrl null;
  49.     #[ORM\Column(options: ["default" => false])]
  50.     private ?bool $isDefault false;
  51.     public function __construct()
  52.     {
  53.         if (is_null($this->createdAt)) $this->createdAt = new DateTimeImmutable();
  54.         $this->updatedAt = new DateTimeImmutable();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getName(): ?string
  61.     {
  62.         return $this->name;
  63.     }
  64.     public function setName(string $name): static
  65.     {
  66.         $this->name $name;
  67.         return $this;
  68.     }
  69.     public function isIsActif(): ?bool
  70.     {
  71.         return $this->isActif;
  72.     }
  73.     public function setIsActif(bool $isActif): static
  74.     {
  75.         $this->isActif $isActif;
  76.         return $this;
  77.     }
  78.     public function getTokenTelegram(): ?string
  79.     {
  80.         return $this->token_telegram;
  81.     }
  82.     public function setTokenTelegram(?string $token_telegram): static
  83.     {
  84.         $this->token_telegram $token_telegram;
  85.         return $this;
  86.     }
  87.     public function getDescription(): ?string
  88.     {
  89.         return $this->description;
  90.     }
  91.     public function setDescription(?string $description): static
  92.     {
  93.         $this->description $description;
  94.         return $this;
  95.     }
  96.     public function getEstablishment(): ?Establishment
  97.     {
  98.         return $this->establishment;
  99.     }
  100.     public function setEstablishment(?Establishment $establishment): static
  101.     {
  102.         $this->establishment $establishment;
  103.         return $this;
  104.     }
  105.     public function getConfig(): ?array
  106.     {
  107.         return $this->config;
  108.     }
  109.     public function setConfig(?array $config): static
  110.     {
  111.         $this->config $config;
  112.         return $this;
  113.     }
  114.     public function getIntroMessage(): ?string
  115.     {
  116.         return $this->introMessage;
  117.     }
  118.     public function setIntroMessage(?string $introMessage): static
  119.     {
  120.         $this->introMessage $introMessage;
  121.         return $this;
  122.     }
  123.     public function getChatServer(): ?string
  124.     {
  125.         return $this->chatServer;
  126.     }
  127.     public function setChatServer(?string $chatServer): static
  128.     {
  129.         $this->chatServer $chatServer;
  130.         return $this;
  131.     }
  132.     public function getTitle(): ?string
  133.     {
  134.         return $this->title;
  135.     }
  136.     public function setTitle(?string $title): static
  137.     {
  138.         $this->title $title;
  139.         return $this;
  140.     }
  141.     public function getMainColor(): ?string
  142.     {
  143.         return $this->mainColor;
  144.     }
  145.     public function setMainColor(?string $mainColor): static
  146.     {
  147.         $this->mainColor $mainColor;
  148.         return $this;
  149.     }
  150.     public function getBubbleBackground(): ?string
  151.     {
  152.         return $this->bubbleBackground;
  153.     }
  154.     public function setBubbleBackground(?string $bubbleBackground): static
  155.     {
  156.         $this->bubbleBackground $bubbleBackground;
  157.         return $this;
  158.     }
  159.     public function getPlaceholderText(): ?string
  160.     {
  161.         return $this->placeholderText;
  162.     }
  163.     public function setPlaceholderText(?string $placeholderText): static
  164.     {
  165.         $this->placeholderText $placeholderText;
  166.         return $this;
  167.     }
  168.     public function getAboutLink(): ?string
  169.     {
  170.         return $this->aboutLink;
  171.     }
  172.     public function setAboutLink(?string $aboutLink): static
  173.     {
  174.         $this->aboutLink $aboutLink;
  175.         return $this;
  176.     }
  177.     public function getAboutText(): ?string
  178.     {
  179.         return $this->aboutText;
  180.     }
  181.     public function setAboutText(?string $aboutText): static
  182.     {
  183.         $this->aboutText $aboutText;
  184.         return $this;
  185.     }
  186.     public function getBubbleAvatarUrl(): ?Attachment
  187.     {
  188.         return $this->bubbleAvatarUrl;
  189.     }
  190.     public function setBubbleAvatarUrl(?Attachment $bubbleAvatarUrl): static
  191.     {
  192.         $this->bubbleAvatarUrl $bubbleAvatarUrl;
  193.         return $this;
  194.     }
  195.     public function isIsDefault(): ?bool
  196.     {
  197.         return $this->isDefault;
  198.     }
  199.     public function setIsDefault(bool $isDefault): static
  200.     {
  201.         $this->isDefault $isDefault;
  202.         return $this;
  203.     }
  204.     public function __serialize(): array
  205.     {
  206.         return [
  207.             $this->name,
  208.             $this->description,
  209.             $this->mainColor,
  210.             $this->bubbleBackground,
  211.             $this->introMessage,
  212.             $this->chatServer,
  213.             $this->title,
  214.             $this->bubbleAvatarUrl,
  215.         ];
  216.     }
  217.     public function __unserialize(array $data): void
  218.     {
  219.         list(
  220.             $this->name,
  221.             $this->description,
  222.             $this->mainColor,
  223.             $this->bubbleBackground,
  224.             $this->introMessage,
  225.             $this->chatServer,
  226.             $this->title,
  227.             $this->bubbleAvatarUrl,
  228.         ) = $data;
  229.     }
  230. }