<?php
namespace App\Entity;
use App\Repository\TVARepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TVARepository::class)
*/
class TVA
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=Users::class, mappedBy="tva")
*/
private $users;
/**
* @ORM\OneToMany(targetEntity=RequestModification::class, mappedBy="tvaSubject")
*/
private $requestModifications;
public function __construct()
{
$this->users = new ArrayCollection();
$this->requestModifications = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, Users>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(Users $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setTva($this);
}
return $this;
}
public function removeUser(Users $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getTva() === $this) {
$user->setTva(null);
}
}
return $this;
}
/**
* @return Collection<int, RequestModification>
*/
public function getRequestModifications(): Collection
{
return $this->requestModifications;
}
public function addRequestModification(RequestModification $requestModification): self
{
if (!$this->requestModifications->contains($requestModification)) {
$this->requestModifications[] = $requestModification;
$requestModification->setTvaSubject($this);
}
return $this;
}
public function removeRequestModification(RequestModification $requestModification): self
{
if ($this->requestModifications->removeElement($requestModification)) {
// set the owning side to null (unless already changed)
if ($requestModification->getTvaSubject() === $this) {
$requestModification->setTvaSubject(null);
}
}
return $this;
}
}