src/Entity/TVA.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TVARepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TVARepository::class)
  9.  */
  10. class TVA
  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=Users::class, mappedBy="tva")
  24.      */
  25.     private $users;
  26.     /**
  27.      * @ORM\OneToMany(targetEntity=RequestModification::class, mappedBy="tvaSubject")
  28.      */
  29.     private $requestModifications;
  30.     public function __construct()
  31.     {
  32.         $this->users = new ArrayCollection();
  33.         $this->requestModifications = new ArrayCollection();
  34.     }
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48.     /**
  49.      * @return Collection<int, Users>
  50.      */
  51.     public function getUsers(): Collection
  52.     {
  53.         return $this->users;
  54.     }
  55.     public function addUser(Users $user): self
  56.     {
  57.         if (!$this->users->contains($user)) {
  58.             $this->users[] = $user;
  59.             $user->setTva($this);
  60.         }
  61.         return $this;
  62.     }
  63.     public function removeUser(Users $user): self
  64.     {
  65.         if ($this->users->removeElement($user)) {
  66.             // set the owning side to null (unless already changed)
  67.             if ($user->getTva() === $this) {
  68.                 $user->setTva(null);
  69.             }
  70.         }
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, RequestModification>
  75.      */
  76.     public function getRequestModifications(): Collection
  77.     {
  78.         return $this->requestModifications;
  79.     }
  80.     public function addRequestModification(RequestModification $requestModification): self
  81.     {
  82.         if (!$this->requestModifications->contains($requestModification)) {
  83.             $this->requestModifications[] = $requestModification;
  84.             $requestModification->setTvaSubject($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeRequestModification(RequestModification $requestModification): self
  89.     {
  90.         if ($this->requestModifications->removeElement($requestModification)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($requestModification->getTvaSubject() === $this) {
  93.                 $requestModification->setTvaSubject(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98. }