<?phpnamespace App\Entity;use App\Repository\BillingPointRepository;use App\Traits\AddressTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use JMS\Serializer\Annotation as Serializer;use JMS\Serializer\Annotation\Expose;use JMS\Serializer\Annotation\Groups;/** * @ORM\Entity(repositoryClass=BillingPointRepository::class) * * @Serializer\ExclusionPolicy("ALL") */class BillingPoint{ use AddressTrait; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") * * @Expose * @Groups({"billingpoint", "export_billingpoint_datatable"}) */ private $id; /** * @ORM\OneToMany(targetEntity=User::class, mappedBy="billingPoint") * * @Expose * @Groups({"billingpoint"}) */ private $users; /** * @ORM\Column(type="string", length=16, nullable=true) */ private $TvaNumber; public function __construct() { $this->users = new ArrayCollection(); } public function __toString() { return $this->getName(); } public function getId(): ?int { return $this->id; } /** * @return Collection<int, User> */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users[] = $user; $user->setBillingPoint($this); } return $this; } public function removeUser(User $user): self { if ($this->users->removeElement($user)) { // set the owning side to null (unless already changed) if ($user->getBillingPoint() === $this) { $user->setBillingPoint(null); } } return $this; } public function getTvaNumber(): ?string { return $this->TvaNumber; } public function setTvaNumber(?string $TvaNumber): self { $this->TvaNumber = $TvaNumber; return $this; }}