src/Entity/StructuresCategories.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StructuresCategoriesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=StructuresCategoriesRepository::class)
  9.  * @ORM\Table(name="StructuresCategories")
  10.  */
  11. class StructuresCategories
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $label;
  23.     /**
  24.      * @ORM\Column(type="text", nullable=true)
  25.      */
  26.     private $description;
  27.     /**
  28.      * @ORM\OneToMany(targetEntity=Structures::class, mappedBy="category", orphanRemoval=true)
  29.      */
  30.     private $structures;
  31.     /**
  32.      * @ORM\Column(type="string", length=255, nullable=true)
  33.      */
  34.     private $slug;
  35.     /**
  36.      * @ORM\Column(type="boolean", nullable=true)
  37.      */
  38.     private $isEnabled;
  39.     public function __construct()
  40.     {
  41.         $this->faqs = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getLabel(): ?string
  48.     {
  49.         return $this->label;
  50.     }
  51.     public function setLabel(string $label): self
  52.     {
  53.         $this->label $label;
  54.         return $this;
  55.     }
  56.     public function getDescription(): ?string
  57.     {
  58.         return $this->description;
  59.     }
  60.     public function setDescription(?string $description): self
  61.     {
  62.         $this->description $description;
  63.         return $this;
  64.     }
  65.     public function getStructures(): Collection
  66.     {
  67.         return $this->structures;
  68.     }
  69.     public function addStructure(Structures $structure): self
  70.     {
  71.         if (!$this->structures->contains($structure)) {
  72.             $this->structures[] = $structure;
  73.             $structure->setCategory($this);
  74.         }
  75.         return $this;
  76.     }
  77.     public function removeStructure(Structures $structure): self
  78.     {
  79.         if ($this->structures->contains($structure)) {
  80.             $this->structures->removeElement($structure);
  81.             // set the owning side to null (unless already changed)
  82.             if ($structure->getCategory() === $this) {
  83.                 $structure->setCategory(null);
  84.             }
  85.         }
  86.         return $this;
  87.     }
  88.     public function __toString()
  89.     {
  90.         return $this->label;
  91.     }
  92.     public function getSlug(): ?string
  93.     {
  94.         return $this->slug;
  95.     }
  96.     public function setSlug(?string $slug): self
  97.     {
  98.         $this->slug $slug;
  99.         return $this;
  100.     }
  101.     public function getIsEnabled(): ?bool
  102.     {
  103.         return $this->isEnabled;
  104.     }
  105.     public function setIsEnabled(?bool $isEnabled): self
  106.     {
  107.         $this->isEnabled $isEnabled;
  108.         return $this;
  109.     }
  110. }