src/Entity/Prescriber.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PrescriberRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use JetBrains\PhpStorm\Pure;
  10. #[ORM\Entity(repositoryClassPrescriberRepository::class)]
  11. class Prescriber extends User
  12. {
  13.     use IdentifiableTrait;
  14.     #[ORM\ManyToMany(targetEntityPrescriberSpeciality::class, inversedBy'prescribers')]
  15.     private Collection $specialities;
  16.     #[ORM\OneToMany(mappedBy'prescriber'targetEntityInvoice::class)]
  17.     private Collection $invoices;
  18.     // Code Bionops du prescripteur
  19.     #[ORM\Column(length255nullabletrueuniquetrue)]
  20.     private ?string $prescriberCode null;
  21.     #[ORM\Column]
  22.     private ?float $pointCoefficient null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $address null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $address2 null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  28.     private ?\DateTimeInterface $activityStartDate null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $civility null;
  31.     #[ORM\Column(length255)]
  32.     private ?string $lastname null;
  33.     #[ORM\Column(length255)]
  34.     private ?string $firstname null;
  35.     #[ORM\Column(length255)]
  36.     private ?string $postalCode null;
  37.     #[ORM\Column(length255)]
  38.     private ?string $city null;
  39.     #[ORM\Column(length255)]
  40.     private ?string $phone null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $position null;
  43.     #[ORM\ManyToOne(inversedBy'prescribers')]
  44.     #[ORM\JoinColumn(nullabletrue)]
  45.     private ?Commercial $commercial null;
  46.     #[ORM\OneToMany(mappedBy'prescriber'targetEntityPrescriptionPadOrder::class)]
  47.     private Collection $prescriptionPadOrders;
  48.     #[ORM\OneToMany(mappedBy'prescriber'targetEntityPrescriberPoint::class)]
  49.     private Collection $points;
  50.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  51.     private ?\DateTimeInterface $lastPrescriptionDate null;
  52.     #[ORM\Column(length255nullabletrue)]
  53.     private ?string $company null;
  54.     #[ORM\ManyToOne(inversedBy'prescribers')]
  55.     private ?PrescriberCategory $category null;
  56.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  57.     private ?\DateTimeInterface $prescriberValidationDate null;
  58.     #[ORM\Column]
  59.     private ?DateTimeImmutable $created_at null;
  60.     #[ORM\Column(nullabletrue)]
  61.     private ?DateTimeImmutable $updated_at null;
  62.     // Identifiant interne du prescripteur dans extranet
  63.     #[ORM\Column(length255)]
  64.     private ?string $extranetCode null;
  65.     #[ORM\ManyToOne(inversedBy'prescribersByMainSpeciality')]
  66.     private ?PrescriberSpeciality $mainSpeciality null;
  67.     #[ORM\ManyToOne(inversedBy'prescribers')]
  68.     private ?Country $country null;
  69.     // Code Codial du prescripteur (code client)
  70.     #[ORM\Column(length255nullabletrue)]
  71.     private ?string $codialClientCode null;
  72.     #[ORM\Column(nullabletrue)]
  73.     private ?bool $needToBeExported null;
  74.     #[ORM\ManyToOne(inversedBy'prescribers')]
  75.     private ?BillingCenter $billingCenter null;
  76.     #[ORM\Column(nullabletrue)]
  77.     private ?bool $approved null;
  78.     #[ORM\ManyToOne()]
  79.     private ?User $createdBy null;
  80.     #[ORM\OneToMany(mappedBy'prescriber'targetEntityVisitReport::class, orphanRemovaltrue)]
  81.     private Collection $visitReports;
  82.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  83.     private ?\DateTimeImmutable $visitDate null;
  84.     #[ORM\ManyToOne(inversedBy'prescribers')]
  85.     private ?PrescriberActivityStatus $activityStatus null;
  86.     #[ORM\ManyToMany(targetEntityBookingEvent::class, mappedBy'prescriberSpeakers')]
  87.     private Collection $prescriberSpeakersBookingEvents;
  88.     #[ORM\Column(length255nullabletrue)]
  89.     private ?string $title null;
  90.     #[ORM\Column(length255nullabletrue)]
  91.     private ?string $rppsNumber null;
  92.     #[ORM\Column(length255nullabletrue)]
  93.     private ?string $sirenNumber null;
  94.     #[ORM\Column(length255nullabletrueoptions: ['comment' => 'Comment le prescripteur a connu Bionops'])]
  95.     private ?string $sourceDiscovery null;
  96.     #[Pure] public function __construct()
  97.     {
  98.         $this->specialities                    = new ArrayCollection();
  99.         $this->invoices                        = new ArrayCollection();
  100.         $this->prescriptionPadOrders           = new ArrayCollection();
  101.         $this->points                          = new ArrayCollection();
  102.         $this->visitReports                    = new ArrayCollection();
  103.         $this->prescriberSpeakersBookingEvents = new ArrayCollection();
  104.     }
  105.     public function __toString(): string
  106.     {
  107.         return $this->getFullName();
  108.     }
  109.     public function getId(): ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     /**
  114.      * @return Collection<int, PrescriberSpeciality>
  115.      */
  116.     public function getSpecialities(): Collection
  117.     {
  118.         return $this->specialities;
  119.     }
  120.     public function addSpeciality(PrescriberSpeciality $speciality): self
  121.     {
  122.         if (!$this->specialities->contains($speciality)) {
  123.             $this->specialities->add($speciality);
  124.         }
  125.         return $this;
  126.     }
  127.     public function removeSpeciality(PrescriberSpeciality $speciality): self
  128.     {
  129.         $this->specialities->removeElement($speciality);
  130.         return $this;
  131.     }
  132.     /**
  133.      * @return Collection<int, Invoice>
  134.      */
  135.     public function getInvoices(): Collection
  136.     {
  137.         return $this->invoices;
  138.     }
  139.     public function addInvoice(Invoice $invoice): self
  140.     {
  141.         if (!$this->invoices->contains($invoice)) {
  142.             $this->invoices->add($invoice);
  143.             $invoice->setPrescriber($this);
  144.         }
  145.         return $this;
  146.     }
  147.     public function removeInvoice(Invoice $invoice): self
  148.     {
  149.         if ($this->invoices->removeElement($invoice)) {
  150.             // set the owning side to null (unless already changed)
  151.             if ($invoice->getPrescriber() === $this) {
  152.                 $invoice->setPrescriber(null);
  153.             }
  154.         }
  155.         return $this;
  156.     }
  157.     public function getPrescriberCode(): ?string
  158.     {
  159.         return $this->prescriberCode;
  160.     }
  161.     public function setPrescriberCode(string $prescriberCode): self
  162.     {
  163.         $this->prescriberCode $prescriberCode;
  164.         return $this;
  165.     }
  166.     public function getPointCoefficient(): ?float
  167.     {
  168.         return $this->pointCoefficient;
  169.     }
  170.     public function setPointCoefficient(float $pointCoefficient): self
  171.     {
  172.         $this->pointCoefficient $pointCoefficient;
  173.         return $this;
  174.     }
  175.     public function getAddress(): ?string
  176.     {
  177.         return $this->address;
  178.     }
  179.     public function setAddress(string $address): self
  180.     {
  181.         $this->address $address !== null strtoupper($address) : null;
  182.         return $this;
  183.     }
  184.     public function getAddress2(): ?string
  185.     {
  186.         return $this->address2;
  187.     }
  188.     public function setAddress2(?string $address2): self
  189.     {
  190.         $this->address2 $address2 !== null strtoupper($address2) : null;
  191.         return $this;
  192.     }
  193.     public function getActivityStartDate(): ?\DateTimeInterface
  194.     {
  195.         return $this->activityStartDate;
  196.     }
  197.     public function setActivityStartDate(?\DateTimeInterface $activityStartDate): self
  198.     {
  199.         $this->activityStartDate $activityStartDate;
  200.         return $this;
  201.     }
  202.     public function getLastname(): ?string
  203.     {
  204.         return $this->lastname;
  205.     }
  206. public function setLastname(string $lastname): self
  207. {
  208.     $this->lastname $lastname !== null strtoupper($lastname) : null;
  209.     return $this;
  210. }
  211.     public function getFirstname(): ?string
  212.     {
  213.         return $this->firstname;
  214.     }
  215.     public function getFullName(): ?string
  216.     {
  217.         return $this->getLastname() . " " $this->getFirstname();
  218.     }
  219. public function setFirstname(string $firstname): self
  220. {
  221.     $this->firstname $firstname !== null strtoupper($firstname) : null;
  222.     return $this;
  223. }
  224.     public function getPostalCode(): ?string
  225.     {
  226.         return $this->postalCode;
  227.     }
  228.     public function setPostalCode(string $postalCode): self
  229.     {
  230.         $this->postalCode $postalCode;
  231.         return $this;
  232.     }
  233.     public function getCity(): ?string
  234.     {
  235.         return $this->city;
  236.     }
  237.     public function setCity(string $city): self
  238.     {
  239.         $this->city $city !== null strtoupper($city) : $city;
  240.         return $this;
  241.     }
  242.     public function getPhone(): ?string
  243.     {
  244.         return $this->phone;
  245.     }
  246.     public function setPhone(string $phone): self
  247.     {
  248.         $this->phone $phone;
  249.         return $this;
  250.     }
  251.     public function getPosition(): ?string
  252.     {
  253.         return $this->position;
  254.     }
  255.     public function setPosition(string $position): self
  256.     {
  257.         $this->position $position;
  258.         return $this;
  259.     }
  260.     public function getCommercial(): ?Commercial
  261.     {
  262.         return $this->commercial;
  263.     }
  264.     public function setCommercial(?Commercial $commercial): self
  265.     {
  266.         $this->commercial $commercial;
  267.         return $this;
  268.     }
  269.     /**
  270.      * @return Collection<int, PrescriptionPadOrder>
  271.      */
  272.     public function getPrescriptionPadOrders(): Collection
  273.     {
  274.         return $this->prescriptionPadOrders;
  275.     }
  276.     public function addPrescriptionPadOrder(PrescriptionPadOrder $prescriptionPadOrder): self
  277.     {
  278.         if (!$this->prescriptionPadOrders->contains($prescriptionPadOrder)) {
  279.             $this->prescriptionPadOrders->add($prescriptionPadOrder);
  280.             $prescriptionPadOrder->setPrescriber($this);
  281.         }
  282.         return $this;
  283.     }
  284.     public function removePrescriptionPadOrder(PrescriptionPadOrder $prescriptionPadOrder): self
  285.     {
  286.         if ($this->prescriptionPadOrders->removeElement($prescriptionPadOrder)) {
  287.             // set the owning side to null (unless already changed)
  288.             if ($prescriptionPadOrder->getPrescriber() === $this) {
  289.                 $prescriptionPadOrder->setPrescriber(null);
  290.             }
  291.         }
  292.         return $this;
  293.     }
  294.     /**
  295.      * @return Collection<int, PrescriberPoint>
  296.      */
  297.     public function getPoints(): Collection
  298.     {
  299.         return $this->points;
  300.     }
  301.     public function addPoint(PrescriberPoint $point): self
  302.     {
  303.         if (!$this->points->contains($point)) {
  304.             $this->points->add($point);
  305.             $point->setPrescriber($this);
  306.         }
  307.         return $this;
  308.     }
  309.     public function removePoint(PrescriberPoint $point): self
  310.     {
  311.         if ($this->points->removeElement($point)) {
  312.             // set the owning side to null (unless already changed)
  313.             if ($point->getPrescriber() === $this) {
  314.                 $point->setPrescriber(null);
  315.             }
  316.         }
  317.         return $this;
  318.     }
  319.     public function getLastPrescriptionDate(): ?\DateTimeInterface
  320.     {
  321.         return $this->lastPrescriptionDate;
  322.     }
  323.     public function setLastPrescriptionDate(?\DateTimeInterface $lastPrescriptionDate): self
  324.     {
  325.         $this->lastPrescriptionDate $lastPrescriptionDate;
  326.         return $this;
  327.     }
  328.     public function getCompany(): ?string
  329.     {
  330.         return $this->company;
  331.     }
  332.     public function setCompany(?string $company): self
  333.     {
  334.         $this->company $company;
  335.         return $this;
  336.     }
  337.     public function getCategory(): ?PrescriberCategory
  338.     {
  339.         return $this->category;
  340.     }
  341.     public function setCategory(?PrescriberCategory $category): self
  342.     {
  343.         $this->category $category;
  344.         return $this;
  345.     }
  346.     public function getPrescriberValidationDate(): ?\DateTimeInterface
  347.     {
  348.         return $this->prescriberValidationDate;
  349.     }
  350.     public function setPrescriberValidationDate(?\DateTimeInterface $prescriberValidationDate): self
  351.     {
  352.         $this->prescriberValidationDate $prescriberValidationDate;
  353.         return $this;
  354.     }
  355.     public function getCreatedAt(): ?DateTimeImmutable
  356.     {
  357.         return $this->created_at;
  358.     }
  359.     public function setCreatedAt(DateTimeImmutable $created_at): self
  360.     {
  361.         $this->created_at $created_at;
  362.         return $this;
  363.     }
  364.     public function getUpdatedAt(): ?DateTimeImmutable
  365.     {
  366.         return $this->updated_at;
  367.     }
  368.     public function setUpdatedAt(?DateTimeImmutable $updated_at): self
  369.     {
  370.         $this->updated_at $updated_at;
  371.         return $this;
  372.     }
  373.     public function getExtranetCode(): ?string
  374.     {
  375.         return $this->extranetCode;
  376.     }
  377.     public function setExtranetCode(string $extranetCode): self
  378.     {
  379.         $this->extranetCode $extranetCode;
  380.         return $this;
  381.     }
  382.     public function getMainSpeciality(): ?PrescriberSpeciality
  383.     {
  384.         return $this->mainSpeciality;
  385.     }
  386.     public function setMainSpeciality(?PrescriberSpeciality $mainSpeciality): self
  387.     {
  388.         $this->mainSpeciality $mainSpeciality;
  389.         return $this;
  390.     }
  391.     public function getCountry(): ?Country
  392.     {
  393.         return $this->country;
  394.     }
  395.     public function setCountry(?Country $country): self
  396.     {
  397.         $this->country $country;
  398.         return $this;
  399.     }
  400.     public function getCodialClientCode(): ?string
  401.     {
  402.         return $this->codialClientCode;
  403.     }
  404.     public function setCodialClientCode(?string $codialClientCode): self
  405.     {
  406.         $this->codialClientCode $codialClientCode;
  407.         return $this;
  408.     }
  409.     public function isNeedToBeExported(): ?bool
  410.     {
  411.         return $this->needToBeExported;
  412.     }
  413.     public function setNeedToBeExported(?bool $needToBeExported): self
  414.     {
  415.         $this->needToBeExported $needToBeExported;
  416.         return $this;
  417.     }
  418.     public function getBillingCenter(): ?BillingCenter
  419.     {
  420.         return $this->billingCenter;
  421.     }
  422.     public function setBillingCenter(?BillingCenter $billingCenter): self
  423.     {
  424.         $this->billingCenter $billingCenter;
  425.         return $this;
  426.     }
  427.     public function isApproved(): ?bool
  428.     {
  429.         return $this->approved;
  430.     }
  431.     public function setApproved(?bool $approved): static
  432.     {
  433.         $this->approved $approved;
  434.         return $this;
  435.     }
  436.     public function getCreatedBy(): ?User
  437.     {
  438.         return $this->createdBy;
  439.     }
  440.     public function setCreatedBy(?User $createdBy): static
  441.     {
  442.         $this->createdBy $createdBy;
  443.         return $this;
  444.     }
  445.     /**
  446.      * @return Collection<int, VisitReport>
  447.      */
  448.     public function getVisitReports(): Collection
  449.     {
  450.         return $this->visitReports;
  451.     }
  452.     public function addVisitReport(VisitReport $visitReport): static
  453.     {
  454.         if (!$this->visitReports->contains($visitReport)) {
  455.             $this->visitReports->add($visitReport);
  456.             $visitReport->setPrescriber($this);
  457.         }
  458.         return $this;
  459.     }
  460.     public function removeVisitReport(VisitReport $visitReport): static
  461.     {
  462.         if ($this->visitReports->removeElement($visitReport)) {
  463.             // set the owning side to null (unless already changed)
  464.             if ($visitReport->getPrescriber() === $this) {
  465.                 $visitReport->setPrescriber(null);
  466.             }
  467.         }
  468.         return $this;
  469.     }
  470.     public function getVisitDate(): ?\DateTimeImmutable
  471.     {
  472.         return $this->visitDate;
  473.     }
  474.     public function setVisitDate(?\DateTimeImmutable $visitDate): static
  475.     {
  476.         $this->visitDate $visitDate;
  477.         return $this;
  478.     }
  479.     public function getActivityStatus(): ?PrescriberActivityStatus
  480.     {
  481.         return $this->activityStatus;
  482.     }
  483.     public function setActivityStatus(?PrescriberActivityStatus $activityStatus): static
  484.     {
  485.         $this->activityStatus $activityStatus;
  486.         return $this;
  487.     }
  488.     /**
  489.      * @return Collection<int, BookingEvent>
  490.      */
  491.     public function getPrescriberSpeakersBookingEvents(): Collection
  492.     {
  493.         return $this->prescriberSpeakersBookingEvents;
  494.     }
  495.     public function addBookingEvent(BookingEvent $bookingEvent): static
  496.     {
  497.         if (!$this->prescriberSpeakersBookingEvents->contains($bookingEvent)) {
  498.             $this->prescriberSpeakersBookingEvents->add($bookingEvent);
  499.             $bookingEvent->addPrescriber($this);
  500.         }
  501.         return $this;
  502.     }
  503.     public function removeBookingEvent(BookingEvent $bookingEvent): static
  504.     {
  505.         if ($this->prescriberSpeakersBookingEvents->removeElement($bookingEvent)) {
  506.             $bookingEvent->removePrescriber($this);
  507.         }
  508.         return $this;
  509.     }
  510.     public function getCivility(): ?string
  511.     {
  512.         return $this->civility;
  513.     }
  514.     public function setCivility(?string $civility): self
  515.     {
  516.         $this->civility $civility;
  517.         return $this;
  518.     }
  519.     public function getTitle(): ?string
  520.     {
  521.         return $this->title;
  522.     }
  523.     public function setTitle(?string $title): self
  524.     {
  525.         $this->title $title;
  526.         return $this;
  527.     }
  528.     public function getRppsNumber(): ?string
  529.     {
  530.         return $this->rppsNumber;
  531.     }
  532.     public function setRppsNumber(?string $rppsNumber): self
  533.     {
  534.         $this->rppsNumber $rppsNumber;
  535.         return $this;
  536.     }
  537.     public function getSirenNumber(): ?string
  538.     {
  539.         return $this->sirenNumber;
  540.     }
  541.     public function setSirenNumber(?string $sirenNumber): static
  542.     {
  543.         $this->sirenNumber $sirenNumber;
  544.         return $this;
  545.     }
  546.     public function getSourceDiscovery(): ?string
  547.     {
  548.         return $this->sourceDiscovery;
  549.     }
  550.     public function setSourceDiscovery(?string $sourceDiscovery): static
  551.     {
  552.         $this->sourceDiscovery $sourceDiscovery;
  553.         return $this;
  554.     }
  555. }