<?php
namespace App\Entity;
use App\Repository\TaxRectificationRequestRepository;
use Doctrine\ORM\Mapping as ORM;
use Stripe\Collection;
/**
* @ORM\Entity(repositoryClass=TaxRectificationRequestRepository::class)
*/
class TaxRectificationRequest
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=255)
*/
private $code;
/**
* @ORM\OneToMany(targetEntity="App\Entity\UserSurvey", mappedBy="taxRectificationRequest")
*/
private $userSurveys;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
/**
* @return \Doctrine\Common\Collections\Collection|UserSurvey[]
*/
public function getUserSurveys(): Collection
{
return $this->userSurveys;
}
public function addUserSurvey(UserSurvey $userSurvey): self
{
if (!$this->userSurveys->contains($userSurvey)) {
$this->userSurveys[] = $userSurvey;
}
return $this;
}
public function removeUserSurvey(UserSurvey $userSurvey): self
{
if ($this->userSurveys->contains($userSurvey)) {
$this->userSurveys->removeElement($userSurvey);
}
return $this;
}
public function getFrontName()
{
$name = $this->getTitle();
if ('CLI_PAPIER' == $this->getCode()) {
return "Via l'envoie de mon formulaire DRIS/TOU";
} elseif ('CLI_ONLINE' == $this->getCode()) {
return 'Via mon compte e-démarches (ge.ch)';
}
return $name;
}
}