src/Entity/TypeReclamation.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\TypeReclamationRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TypeReclamationRepository::class)
  9.  */
  10. class TypeReclamation
  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="typereclamation", 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.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getDesignation(): ?string
  43.     {
  44.         return $this->designation;
  45.     }
  46.     public function setDesignation(string $designation): self
  47.     {
  48.         $this->designation $designation;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return Collection<int, Reclamation>
  53.      */
  54.     public function getReclamations(): Collection
  55.     {
  56.         return $this->reclamations;
  57.     }
  58.     public function addReclamation(Reclamation $reclamation): self
  59.     {
  60.         if (!$this->reclamations->contains($reclamation)) {
  61.             $this->reclamations[] = $reclamation;
  62.             $reclamation->setTypereclamation($this);
  63.         }
  64.         return $this;
  65.     }
  66.     public function removeReclamation(Reclamation $reclamation): self
  67.     {
  68.         if ($this->reclamations->removeElement($reclamation)) {
  69.             // set the owning side to null (unless already changed)
  70.             if ($reclamation->getTypereclamation() === $this) {
  71.                 $reclamation->setTypereclamation(null);
  72.             }
  73.         }
  74.         return $this;
  75.     }
  76.     public function getDesignationEn(): ?string
  77.     {
  78.         return $this->designation_en;
  79.     }
  80.     public function setDesignationEn(?string $designation_en): self
  81.     {
  82.         $this->designation_en $designation_en;
  83.         return $this;
  84.     }
  85. }