src/Entity/ChatbotSection.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ChatbotSectionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassChatbotSectionRepository::class)]
  8. class ChatbotSection
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\ManyToOne(inversedBy'chatbotSections')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?User $createdBy null;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?\DateTimeImmutable $deletedAt null;
  21.     #[ORM\OneToMany(mappedBy'ChatbotSection'targetEntityChatbotPrompt::class, orphanRemovaltrue)]
  22.     private Collection $chatbotPrompts;
  23.     #[ORM\OneToMany(mappedBy'ChatbotSection'targetEntityChatbotSectionDepartment::class, orphanRemovaltrue)]
  24.     private Collection $chatbotSectionDepartments;
  25.     public function __construct()
  26.     {
  27.         $this->chatbotPrompts = new ArrayCollection();
  28.         $this->chatbotSectionDepartments = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(string $name): self
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     public function getCreatedBy(): ?User
  44.     {
  45.         return $this->createdBy;
  46.     }
  47.     public function setCreatedBy(?User $createdBy): self
  48.     {
  49.         $this->createdBy $createdBy;
  50.         return $this;
  51.     }
  52.     public function getDeletedAt(): ?\DateTimeImmutable
  53.     {
  54.         return $this->deletedAt;
  55.     }
  56.     public function setDeletedAt(?\DateTimeImmutable $deletedAt): self
  57.     {
  58.         $this->deletedAt $deletedAt;
  59.         return $this;
  60.     }
  61.     /**
  62.      * @return Collection<int, ChatbotPrompt>
  63.      */
  64.     public function getChatbotPrompts(): Collection
  65.     {
  66.         return $this->chatbotPrompts;
  67.     }
  68.     public function addChatbotPrompt(ChatbotPrompt $chatbotPrompt): self
  69.     {
  70.         if (!$this->chatbotPrompts->contains($chatbotPrompt)) {
  71.             $this->chatbotPrompts->add($chatbotPrompt);
  72.             $chatbotPrompt->setChatbotSection($this);
  73.         }
  74.         return $this;
  75.     }
  76.     public function removeChatbotPrompt(ChatbotPrompt $chatbotPrompt): self
  77.     {
  78.         if ($this->chatbotPrompts->removeElement($chatbotPrompt)) {
  79.             // set the owning side to null (unless already changed)
  80.             if ($chatbotPrompt->getChatbotSection() === $this) {
  81.                 $chatbotPrompt->setChatbotSection(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86.     /**
  87.      * @return Collection<int, ChatbotSectionDepartment>
  88.      */
  89.     public function getChatbotSectionDepartments(): Collection
  90.     {
  91.         return $this->chatbotSectionDepartments;
  92.     }
  93.     public function addChatbotSectionDepartment(ChatbotSectionDepartment $chatbotSectionDepartment): self
  94.     {
  95.         if (!$this->chatbotSectionDepartments->contains($chatbotSectionDepartment)) {
  96.             $this->chatbotSectionDepartments->add($chatbotSectionDepartment);
  97.             $chatbotSectionDepartment->setChatbotSection($this);
  98.         }
  99.         return $this;
  100.     }
  101.     public function removeChatbotSectionDepartment(ChatbotSectionDepartment $chatbotSectionDepartment): self
  102.     {
  103.         if ($this->chatbotSectionDepartments->removeElement($chatbotSectionDepartment)) {
  104.             // set the owning side to null (unless already changed)
  105.             if ($chatbotSectionDepartment->getChatbotSection() === $this) {
  106.                 $chatbotSectionDepartment->setChatbotSection(null);
  107.             }
  108.         }
  109.         return $this;
  110.     }
  111. }