src\Entity\TaxRectificationRequest.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TaxRectificationRequestRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Stripe\Collection;
  6. /**
  7.  * @ORM\Entity(repositoryClass=TaxRectificationRequestRepository::class)
  8.  */
  9. class TaxRectificationRequest
  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 $title;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $code;
  25.     /**
  26.      * @ORM\OneToMany(targetEntity="App\Entity\UserSurvey", mappedBy="taxRectificationRequest")
  27.      */
  28.     private $userSurveys;
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getTitle(): ?string
  34.     {
  35.         return $this->title;
  36.     }
  37.     public function setTitle(string $title): self
  38.     {
  39.         $this->title $title;
  40.         return $this;
  41.     }
  42.     public function getCode(): ?string
  43.     {
  44.         return $this->code;
  45.     }
  46.     public function setCode(string $code): self
  47.     {
  48.         $this->code $code;
  49.         return $this;
  50.     }
  51.     /**
  52.      * @return \Doctrine\Common\Collections\Collection|UserSurvey[]
  53.      */
  54.     public function getUserSurveys(): Collection
  55.     {
  56.         return $this->userSurveys;
  57.     }
  58.     public function addUserSurvey(UserSurvey $userSurvey): self
  59.     {
  60.         if (!$this->userSurveys->contains($userSurvey)) {
  61.             $this->userSurveys[] = $userSurvey;
  62.         }
  63.         return $this;
  64.     }
  65.     public function removeUserSurvey(UserSurvey $userSurvey): self
  66.     {
  67.         if ($this->userSurveys->contains($userSurvey)) {
  68.             $this->userSurveys->removeElement($userSurvey);
  69.         }
  70.         return $this;
  71.     }
  72.     public function getFrontName()
  73.     {
  74.         $name $this->getTitle();
  75.         if ('CLI_PAPIER' == $this->getCode()) {
  76.             return "Via l'envoie de mon formulaire DRIS/TOU";
  77.         } elseif ('CLI_ONLINE' == $this->getCode()) {
  78.             return 'Via mon compte e-démarches (ge.ch)';
  79.         }
  80.         return $name;
  81.     }
  82. }