src/Entity/Qualite.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\QualiteRepository")
  8.  */
  9. class Qualite
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="datetime")
  23.      */
  24.     private $createdAt;
  25.     /**
  26.      * @ORM\OneToMany(targetEntity="App\Entity\SousJacent", mappedBy="qualite")
  27.      */
  28.     private $sousJacents;
  29.     /**
  30.      * @ORM\Column(type="text", nullable=true)
  31.      */
  32.     private $description;
  33.     public function __construct()
  34.     {
  35.         $this->sousJacents = new ArrayCollection();
  36.         $this->createdAt = new \DateTime('now');
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getName(): ?string
  43.     {
  44.         return $this->name;
  45.     }
  46.     public function setName(string $name): self
  47.     {
  48.         $this->name $name;
  49.         return $this;
  50.     }
  51.     public function getCreatedAt(): ?\DateTimeInterface
  52.     {
  53.         return $this->createdAt;
  54.     }
  55.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  56.     {
  57.         $this->createdAt $createdAt;
  58.         return $this;
  59.     }
  60.     /**
  61.      * @return Collection|SousJacent[]
  62.      */
  63.     public function getSousJacents(): Collection
  64.     {
  65.         return $this->sousJacents;
  66.     }
  67.     public function addSousJacent(SousJacent $sousJacent): self
  68.     {
  69.         if (!$this->sousJacents->contains($sousJacent)) {
  70.             $this->sousJacents[] = $sousJacent;
  71.             $sousJacent->setQualite($this);
  72.         }
  73.         return $this;
  74.     }
  75.     public function removeSousJacent(SousJacent $sousJacent): self
  76.     {
  77.         if ($this->sousJacents->contains($sousJacent)) {
  78.             $this->sousJacents->removeElement($sousJacent);
  79.             // set the owning side to null (unless already changed)
  80.             if ($sousJacent->getQualite() === $this) {
  81.                 $sousJacent->setQualite(null);
  82.             }
  83.         }
  84.         return $this;
  85.     }
  86.     public function getDescription(): ?string
  87.     {
  88.         return $this->description;
  89.     }
  90.     public function setDescription(?string $description): self
  91.     {
  92.         $this->description $description;
  93.         return $this;
  94.     }
  95.     public function __toString(): string
  96.     {
  97.         return $this->name;
  98.     }
  99. }