src/Entity/PropositionStatus.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PropositionStatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PropositionStatusRepository::class)
  9.  */
  10. class PropositionStatus
  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 $name;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Proposition::class, mappedBy="statut")
  24.      */
  25.     private $propositions;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      */
  29.     private $badge;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=GroupSuggestion::class, mappedBy="status")
  32.      */
  33.     private $groupSuggestions;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $name_en;
  38.     public function __construct()
  39.     {
  40.         $this->propositions = new ArrayCollection();
  41.         $this->groupSuggestions = new ArrayCollection();
  42.     }
  43.     public function __toString(){
  44.         return $this->getName();
  45.     }
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getName(): ?string
  51.     {
  52.         return $this->name;
  53.     }
  54.     public function setName(string $name): self
  55.     {
  56.         $this->name $name;
  57.         return $this;
  58.     }
  59.     /**
  60.      * @return Collection<int, Proposition>
  61.      */
  62.     public function getPropositions(): Collection
  63.     {
  64.         return $this->propositions;
  65.     }
  66.     public function addProposition(Proposition $proposition): self
  67.     {
  68.         if (!$this->propositions->contains($proposition)) {
  69.             $this->propositions[] = $proposition;
  70.             $proposition->setStatut($this);
  71.         }
  72.         return $this;
  73.     }
  74.     public function removeProposition(Proposition $proposition): self
  75.     {
  76.         if ($this->propositions->removeElement($proposition)) {
  77.             // set the owning side to null (unless already changed)
  78.             if ($proposition->getStatut() === $this) {
  79.                 $proposition->setStatut(null);
  80.             }
  81.         }
  82.         return $this;
  83.     }
  84.     public function getBadge(): ?string
  85.     {
  86.         return $this->badge;
  87.     }
  88.     public function setBadge(string $badge): self
  89.     {
  90.         $this->badge $badge;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, GroupSuggestion>
  95.      */
  96.     public function getGroupSuggestions(): Collection
  97.     {
  98.         return $this->groupSuggestions;
  99.     }
  100.     public function addGroupSuggestion(GroupSuggestion $groupSuggestion): self
  101.     {
  102.         if (!$this->groupSuggestions->contains($groupSuggestion)) {
  103.             $this->groupSuggestions[] = $groupSuggestion;
  104.             $groupSuggestion->setStatus($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeGroupSuggestion(GroupSuggestion $groupSuggestion): self
  109.     {
  110.         if ($this->groupSuggestions->removeElement($groupSuggestion)) {
  111.             // set the owning side to null (unless already changed)
  112.             if ($groupSuggestion->getStatus() === $this) {
  113.                 $groupSuggestion->setStatus(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118.     public function getNameEn(): ?string
  119.     {
  120.         return $this->name_en;
  121.     }
  122.     public function setNameEn(?string $name_en): self
  123.     {
  124.         $this->name_en $name_en;
  125.         return $this;
  126.     }
  127. }