src/Entity/EtatReclamation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\Collection;
  5. use App\Repository\EtatReclamationRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. /**
  8.  * @ORM\Entity(repositoryClass=EtatReclamationRepository::class)
  9.  */
  10. class EtatReclamation
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $designation;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Reclamation::class, mappedBy="etatreclamation", orphanRemoval=true)
  24.      */
  25.     private $reclamations;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $designation_en;
  30.     public function __construct()
  31.     {
  32.         $this->reclamations = new ArrayCollection();
  33.     }
  34.     public function __toString()
  35.     {
  36.         return $this->getDesignation();
  37.     }
  38.     
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getDesignation(): ?string
  44.     {
  45.         return $this->designation;
  46.     }
  47.     public function setDesignation(string $designation): self
  48.     {
  49.         $this->designation $designation;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection<int, Reclamation>
  54.      */
  55.     public function getReclamations(): Collection
  56.     {
  57.         return $this->reclamations;
  58.     }
  59.     public function addReclamation(Reclamation $reclamation): self
  60.     {
  61.         if (!$this->reclamations->contains($reclamation)) {
  62.             $this->reclamations[] = $reclamation;
  63.             $reclamation->setEtatreclamation($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeReclamation(Reclamation $reclamation): self
  68.     {
  69.         if ($this->reclamations->removeElement($reclamation)) {
  70.             // set the owning side to null (unless already changed)
  71.             if ($reclamation->getEtatreclamation() === $this) {
  72.                 $reclamation->setEtatreclamation(null);
  73.             }
  74.         }
  75.         return $this;
  76.     }
  77.     public function getDesignationEn(): ?string
  78.     {
  79.         return $this->designation_en;
  80.     }
  81.     public function setDesignationEn(?string $designation_en): self
  82.     {
  83.         $this->designation_en $designation_en;
  84.         return $this;
  85.     }
  86. }