src/Entity/EnqueteEntrepriseSection.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EnqueteEntrepriseSectionRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=EnqueteEntrepriseSectionRepository::class)
  10.  */
  11. class EnqueteEntrepriseSection
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="text")
  21.      */
  22.     private $libelle;
  23.     /**
  24.      * @ORM\Column(type="datetime_immutable")
  25.      */
  26.     private $createdAt;
  27.     /**
  28.      * @ORM\OrderBy({"position" = "ASC"})
  29.      * @ORM\OneToMany(targetEntity=EnqueteEntrepriseSectionChild::class, mappedBy="enqueteEntrepriseSection",cascade={"persist"})
  30.      */
  31.     private $enqueteEntrepriseSectionChildren;
  32.     public function __construct()
  33.     {
  34.         $this->enqueteEntrepriseSectionChildren = new ArrayCollection();
  35.         $this->createdAt = new \DateTimeImmutable();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getLibelle(): ?string
  42.     {
  43.         return $this->libelle;
  44.     }
  45.     public function setLibelle(string $libelle): self
  46.     {
  47.         $this->libelle $libelle;
  48.         return $this;
  49.     }
  50.     public function getCreatedAt(): ?\DateTimeImmutable
  51.     {
  52.         return $this->createdAt;
  53.     }
  54.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  55.     {
  56.         $this->createdAt $createdAt;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return Collection<int, EnqueteEntrepriseSectionChild>
  61.      */
  62.     public function getEnqueteEntrepriseSectionChildren(): Collection
  63.     {
  64.         return $this->enqueteEntrepriseSectionChildren;
  65.     }
  66.     public function addEnqueteEntrepriseSectionChild(EnqueteEntrepriseSectionChild $enqueteEntrepriseSectionChild): self
  67.     {
  68.         if (!$this->enqueteEntrepriseSectionChildren->contains($enqueteEntrepriseSectionChild)) {
  69.             $this->enqueteEntrepriseSectionChildren[] = $enqueteEntrepriseSectionChild;
  70.             $enqueteEntrepriseSectionChild->setEnqueteEntrepriseSection($this);
  71.         }
  72.         return $this;
  73.     }
  74.     public function removeEnqueteEntrepriseSectionChild(EnqueteEntrepriseSectionChild $enqueteEntrepriseSectionChild): self
  75.     {
  76.         if ($this->enqueteEntrepriseSectionChildren->removeElement($enqueteEntrepriseSectionChild)) {
  77.             // set the owning side to null (unless already changed)
  78.             if ($enqueteEntrepriseSectionChild->getEnqueteEntrepriseSection() === $this) {
  79.                 $enqueteEntrepriseSectionChild->setEnqueteEntrepriseSection(null);
  80.             }
  81.         }
  82.         return $this;
  83.     }
  84. }