src/Entity/VisitReport.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VisitReportRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassVisitReportRepository::class)]
  9. class VisitReport
  10. {
  11.     use IdentifiableTrait;
  12.     #[ORM\ManyToOne(inversedBy'visitReports')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private ?Commercial $visitedBy null;
  15.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  16.     private ?string $meetingReport null;
  17.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  18.     private ?string $assistantAction null;
  19.     #[ORM\OneToOne(inversedBy'visitReport'cascade: ['persist''remove'])]
  20.     private ?BookingVisitReport $booking null;
  21.     #[ORM\ManyToOne(inversedBy'visitReports')]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?Prescriber $prescriber null;
  24.     #[ORM\OneToOne(cascade: ['persist''remove'])]
  25.     private ?Booking $nextBooking null;
  26.     #[ORM\Column(nullabletrue)]
  27.     private ?bool $isApproved null;
  28.     #[ORM\Column(nullabletrue)]
  29.     private ?bool $sendBook null;
  30.     #[ORM\OneToMany(mappedBy'visitReport'targetEntityVisitReportComment::class, orphanRemovaltrue)]
  31.     private Collection $comments;
  32.     #[ORM\OneToMany(mappedBy'visitReport'targetEntityTask::class)]
  33.     private Collection $assistantActionTask;
  34.     #[ORM\ManyToMany(targetEntityDotation::class, inversedBy'visitReportsProductShipmentRequests'cascade: ['persist''remove'])]
  35.     #[ORM\JoinTable(name"visit_report_shipment_request")]
  36.     private Collection $productShipmentRequests;
  37.     #[ORM\ManyToMany(targetEntityDotation::class, inversedBy'visitReportsAwardedDotations'cascade: ['persist''remove'])]
  38.     #[ORM\JoinTable(name"visit_report_awarded_dotations")]
  39.     private Collection $awardedDotations;
  40.     #[ORM\OneToMany(mappedBy'visitReport'targetEntityPrescriptionPad::class)]
  41.     private Collection $prescriptionPads;
  42.     #[ORM\Column]
  43.     private ?bool $isReadyForValidation null;
  44.     #[ORM\Column(nullabletrue)]
  45.     private ?int $sendBdcQty 0;
  46.     public function __construct()
  47.     {
  48.         $this->comments                = new ArrayCollection();
  49.         $this->assistantActionTask     = new ArrayCollection();
  50.         $this->productShipmentRequests = new ArrayCollection();
  51.         $this->awardedDotations        = new ArrayCollection();
  52.         $this->prescriptionPads      = new ArrayCollection();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getVisitedBy(): ?Commercial
  59.     {
  60.         return $this->visitedBy;
  61.     }
  62.     public function setVisitedBy(?Commercial $visitedBy): static
  63.     {
  64.         $this->visitedBy $visitedBy;
  65.         return $this;
  66.     }
  67.     public function getMeetingReport(): ?string
  68.     {
  69.         return $this->meetingReport;
  70.     }
  71.     public function setMeetingReport(string $meetingReport): static
  72.     {
  73.         $this->meetingReport $meetingReport;
  74.         return $this;
  75.     }
  76.     public function getAssistantAction(): ?string
  77.     {
  78.         return $this->assistantAction;
  79.     }
  80.     public function setAssistantAction(?string $assistantAction): static
  81.     {
  82.         $this->assistantAction $assistantAction;
  83.         return $this;
  84.     }
  85.     public function getBooking(): ?Booking
  86.     {
  87.         return $this->booking;
  88.     }
  89.     public function setBooking(?Booking $booking): static
  90.     {
  91.         $this->booking $booking;
  92.         return $this;
  93.     }
  94.     public function getPrescriber(): ?Prescriber
  95.     {
  96.         return $this->prescriber;
  97.     }
  98.     public function setPrescriber(?Prescriber $prescriber): static
  99.     {
  100.         $this->prescriber $prescriber;
  101.         return $this;
  102.     }
  103.     public function getNextBooking(): ?Booking
  104.     {
  105.         return $this->nextBooking;
  106.     }
  107.     public function setNextBooking(?Booking $nextBooking): static
  108.     {
  109.         $this->nextBooking $nextBooking;
  110.         return $this;
  111.     }
  112.     public function isApproved(): ?bool
  113.     {
  114.         return $this->isApproved;
  115.     }
  116.     public function setIsApproved(?bool $isApproved): static
  117.     {
  118.         $this->isApproved $isApproved;
  119.         return $this;
  120.     }
  121.     public function isSendBook(): ?bool
  122.     {
  123.         return $this->sendBook;
  124.     }
  125.     public function setSendBook(?bool $sendBook): static
  126.     {
  127.         $this->sendBook $sendBook;
  128.         return $this;
  129.     }
  130.     /**
  131.      * @return Collection<int, VisitReportComment>
  132.      */
  133.     public function getComments(): Collection
  134.     {
  135.         return $this->comments;
  136.     }
  137.     public function addComment(VisitReportComment $comment): static
  138.     {
  139.         if (!$this->comments->contains($comment)) {
  140.             $this->comments->add($comment);
  141.             $comment->setVisitReport($this);
  142.         }
  143.         return $this;
  144.     }
  145.     public function removeComment(VisitReportComment $comment): static
  146.     {
  147.         if ($this->comments->removeElement($comment)) {
  148.             // set the owning side to null (unless already changed)
  149.             if ($comment->getVisitReport() === $this) {
  150.                 $comment->setVisitReport(null);
  151.             }
  152.         }
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection<int, Task>
  157.      */
  158.     public function getAssistantActionTask(): Collection
  159.     {
  160.         return $this->assistantActionTask;
  161.     }
  162.     public function addAssistantActionTask(Task $assistantActionTask): static
  163.     {
  164.         if (!$this->assistantActionTask->contains($assistantActionTask)) {
  165.             $this->assistantActionTask->add($assistantActionTask);
  166.             $assistantActionTask->setVisitReport($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeAssistantActionTask(Task $assistantActionTask): static
  171.     {
  172.         if ($this->assistantActionTask->removeElement($assistantActionTask)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($assistantActionTask->getVisitReport() === $this) {
  175.                 $assistantActionTask->setVisitReport(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection<int, Dotation>
  182.      */
  183.     public function getProductShipmentRequests(): Collection
  184.     {
  185.         return $this->productShipmentRequests;
  186.     }
  187.     public function addProductShipmentRequest(Dotation $productShipmentRequest): static
  188.     {
  189.         if (!$this->productShipmentRequests->contains($productShipmentRequest)) {
  190.             $this->productShipmentRequests->add($productShipmentRequest);
  191.         }
  192.         return $this;
  193.     }
  194.     public function removeProductShipmentRequest(Dotation $productShipmentRequest): static
  195.     {
  196.         $this->productShipmentRequests->removeElement($productShipmentRequest);
  197.         return $this;
  198.     }
  199.     /**
  200.      * @return Collection<int, Dotation>
  201.      */
  202.     public function getAwardedDotations(): Collection
  203.     {
  204.         return $this->awardedDotations;
  205.     }
  206.     public function addAwardedDotation(Dotation $awardedDotation): static
  207.     {
  208.         if (!$this->awardedDotations->contains($awardedDotation)) {
  209.             $this->awardedDotations->add($awardedDotation);
  210.         }
  211.         return $this;
  212.     }
  213.     public function removeAwardedDotation(Dotation $awardedDotation): static
  214.     {
  215.         $this->awardedDotations->removeElement($awardedDotation);
  216.         return $this;
  217.     }
  218.     /**
  219.      * @return Collection<int, PrescriptionPad>
  220.      */
  221.     public function getPrescriptionPads(): Collection
  222.     {
  223.         return $this->prescriptionPads;
  224.     }
  225.     public function addPrescriptionPad(PrescriptionPad $prescriptionPad): static
  226.     {
  227.         if (!$this->prescriptionPads->contains($prescriptionPad)) {
  228.             $this->prescriptionPads->add($prescriptionPad);
  229.             $prescriptionPad->setVisitReport($this);
  230.         }
  231.         return $this;
  232.     }
  233.     public function removePrescriptionPad(PrescriptionPad $prescriptionPad): static
  234.     {
  235.         if ($this->prescriptionPads->removeElement($prescriptionPad)) {
  236.             // set the owning side to null (unless already changed)
  237.             if ($prescriptionPad->getVisitReport() === $this) {
  238.                 $prescriptionPad->setVisitReport(null);
  239.             }
  240.         }
  241.         return $this;
  242.     }
  243.     public function isIsReadyForValidation(): ?bool
  244.     {
  245.         return $this->isReadyForValidation;
  246.     }
  247.     public function setIsReadyForValidation(bool $isReadyForValidation): static
  248.     {
  249.         $this->isReadyForValidation $isReadyForValidation;
  250.         return $this;
  251.     }
  252.     public function getSendBdcQty(): ?int
  253.     {
  254.         return $this->sendBdcQty;
  255.     }
  256.     public function setSendBdcQty(?int $sendBdcQty): static
  257.     {
  258.         $this->sendBdcQty $sendBdcQty;
  259.         return $this;
  260.     }
  261. }