<?phpnamespace App\Entity\Prescriber;use App\Entity\ProspectOnStore;use App\Entity\User;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use App\Repository\Prescriber\PrescriberRepository;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=PrescriberRepository::class) */class Prescriber{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private string $name; /** * @ORM\OneToOne(targetEntity=User::class, inversedBy="prescriber", cascade={"persist", "remove"}) * @ORM\JoinColumn(nullable=false) */ private User $user; /** * @ORM\OneToMany(targetEntity=ProspectOnStore::class, mappedBy="prescriber") */ private Collection $prospectsOnStore; /** * @ORM\OneToMany(targetEntity=PrescriberRemuneration::class, mappedBy="prescriber", orphanRemoval=true) */ private Collection $remunerations; public function __construct() { $this->prospectsOnStore = new ArrayCollection(); $this->remunerations = new ArrayCollection(); } public function getLabel(): string { return 'Prescriber #'.$this->id; } public function getId(): ?int { return $this->id; } public function getUser(): ?User { return $this->user; } public function setUser(User $user): self { $this->user = $user; return $this; } /** * @return Collection<int, ProspectOnStore> */ public function getProspectsOnStore(): Collection { return $this->prospectsOnStore; } public function addProspectsOnStore(ProspectOnStore $prospectsOnStore): self { if (!$this->prospectsOnStore->contains($prospectsOnStore)) { $this->prospectsOnStore[] = $prospectsOnStore; $prospectsOnStore->setPrescriber($this); } return $this; } public function removeProspectsOnStore(ProspectOnStore $prospectsOnStore): self { if ($this->prospectsOnStore->removeElement($prospectsOnStore)) { // set the owning side to null (unless already changed) if ($prospectsOnStore->getPrescriber() === $this) { $prospectsOnStore->setPrescriber(null); } } return $this; } /** * @return mixed */ public function getName() { return $this->name; } /** * @param mixed $name */ public function setName($name): void { $this->name = $name; } /** * @return Collection<int, PrescriberRemuneration> */ public function getRemunerations(): Collection { return $this->remunerations; } public function addRemuneration(PrescriberRemuneration $prescriberRemuneration): self { if (!$this->remunerations->contains($prescriberRemuneration)) { $this->remunerations[] = $prescriberRemuneration; $prescriberRemuneration->setPrescriber($this); } return $this; } public function removeRemuneration(PrescriberRemuneration $prescriberRemuneration): self { if ($this->remunerations->removeElement($prescriberRemuneration)) { // set the owning side to null (unless already changed) if ($prescriberRemuneration->getPrescriber() === $this) { $prescriberRemuneration->setPrescriber(null); } } return $this; }}