<?phpnamespace App\Entity\Gos;use App\Repository\Gos\ChatbotSectionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ChatbotSectionRepository::class) */class ChatbotSection{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="integer") */ private $position; /** * @ORM\Column(type="boolean", options={"default": 0}) */ private $isMain = false; /** * @ORM\Column(type="string", length=255) */ private $title; /** * @ORM\ManyToOne(targetEntity=ChatbotDialog::class, inversedBy="childrenSections") */ private $parentDialog; /** * @ORM\OneToMany(targetEntity=ChatbotDialog::class, mappedBy="parentSection") */ private $chatbotDialogs; /** * @ORM\ManyToOne(targetEntity=ChatbotDialog::class) */ private $backToDialog; public function __construct() { $this->chatbotDialogs = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getPosition(): ?int { return $this->position; } public function setPosition(int $position): self { $this->position = $position; return $this; } public function getIsMain(): ?bool { return $this->isMain; } public function setIsMain(bool $isMain): self { $this->isMain = $isMain; return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getParentDialog(): ?ChatbotDialog { return $this->parentDialog; } public function setParentDialog(?ChatbotDialog $parentDialog): self { $this->parentDialog = $parentDialog; return $this; } public function getChatbotDialog(): ?ChatbotDialog { if ($this->getChatbotDialogs()->isEmpty() === false) { return $this->getChatbotDialogs()->first(); } return null; } /** * @return Collection|ChatbotDialog[] */ public function getChatbotDialogs(): Collection { return $this->chatbotDialogs; } public function addChatboxDialog(ChatbotDialog $chatboxDialog): self { if (!$this->chatbotDialogs->contains($chatboxDialog)) { $this->chatbotDialogs[] = $chatboxDialog; $chatboxDialog->setParentSection($this); } return $this; } public function removeChatboxDialog(ChatbotDialog $chatboxDialog): self { if ($this->chatbotDialogs->contains($chatboxDialog)) { $this->chatbotDialogs->removeElement($chatboxDialog); // set the owning side to null (unless already changed) if ($chatboxDialog->getParentSection() === $this) { $chatboxDialog->setParentSection(null); } } return $this; } public function findParentSection(): ?ChatbotSection { if ($this->getParentDialog() !== null) { return $this->getParentDialog()->findParentSection(); } return null; } public function getBackToDialog(): ?ChatbotDialog { return $this->backToDialog; } public function setBackToDialog(?ChatbotDialog $backToDialog): self { $this->backToDialog = $backToDialog; return $this; }}