src/Entity/BookingEvent.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BookingEventRepository;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. #[ORM\Entity(repositoryClassBookingEventRepository::class)]
  10. #[Vich\Uploadable]
  11. class BookingEvent extends Booking
  12. {
  13.     use IdentifiableTrait;
  14.     #[ORM\OneToMany(mappedBy'bookingEvent'targetEntityBookingEventFile::class, cascade: ['persist'])]
  15.     private $files;
  16.     #[ORM\Column(type'datetime_immutable')]
  17.     private \DateTimeImmutable $updatedAt;
  18.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  19.     private ?string $description null;
  20.     #[ORM\Column(nullabletrue)]
  21.     private ?int $registeredParticipantCount null;
  22.     #[ORM\Column(nullabletrue)]
  23.     private ?int $actualParticipantCount null;
  24.     #[ORM\Column(nullabletrue)]
  25.     private ?int $maximumCapacity null;
  26.     #[ORM\Column(nullabletrue)]
  27.     private ?float $eventCost null;
  28.     #[ORM\ManyToOne(inversedBy'bookingEvents')]
  29.     private ?BookingEventQuotationStatus $quotationStatus null;
  30.     #[ORM\ManyToOne(inversedBy'bookingEvents')]
  31.     private ?BookingEventDotationStatus $dotationStatus null;
  32.     #[ORM\ManyToOne(inversedBy'bookingEvents')]
  33.     private ?BookingEventInvitationStatus $invitationStatus null;
  34.     #[ORM\ManyToOne(inversedBy'bookingEvents')]
  35.     private ?BookingEventConfirmationMailStatus $confirmationMailStatus null;
  36.     #[ORM\ManyToMany(targetEntityCommercial::class, inversedBy'referentsBookingEvents')]
  37.     #[ORM\JoinTable(name"booking_event_referent")]
  38.     private Collection $referents;
  39.     #[ORM\ManyToMany(targetEntityPrescriber::class, inversedBy'prescriberSpeakersBookingEvents')]
  40.     private Collection $prescriberSpeakers;
  41.     #[ORM\ManyToMany(targetEntityCommercial::class, inversedBy'commercialSpeakersBookingEvents')]
  42.     #[ORM\JoinTable(name"booking_event_commercial_speaker")]
  43.     private Collection $commercialSpeakers;
  44.     #[ORM\ManyToMany(targetEntityBookingUserGroup::class, inversedBy'bookingEvents')]
  45.     private Collection $groups;
  46.     #[ORM\ManyToMany(targetEntityUser::class, inversedBy'bookingEvents')]
  47.     private Collection $users;
  48.     #[ORM\ManyToOne(inversedBy'bookingEvents')]
  49.     private ?BookingEventCategory $eventCategory null;
  50.     #[ORM\ManyToOne(inversedBy'bookingEvents')]
  51.     private ?BookingEventTheme $bookingEventTheme null;
  52.     #[ORM\Column(length255nullabletrue)]
  53.     private ?string $addressLine1 null;
  54.     #[ORM\Column(length255nullabletrue)]
  55.     private ?string $addressLine2 null;
  56.     #[ORM\Column(length10nullabletrue)]
  57.     private ?string $postalCode null;
  58.     #[ORM\Column(length255nullabletrue)]
  59.     private ?string $city null;
  60.     #[ORM\ManyToOne]
  61.     private ?Country $country null;
  62.     #[ORM\Column(length50nullabletrue)]
  63.     private ?string $phone null;
  64.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  65.     private ?\DateTimeImmutable $invoiceReceivedDate null;
  66.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  67.     private ?\DateTimeImmutable $depositPaidDate null;
  68.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  69.     private ?\DateTimeImmutable $invoiceFullyPaidDate null;
  70.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  71.     private ?\DateTimeImmutable $quoteValidatedDate null;
  72.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  73.     private ?\DateTimeImmutable $dotationSentDate null;
  74.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  75.     private ?\DateTimeImmutable $invitationEmailSentDate null;
  76.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  77.     private ?\DateTimeImmutable $reminderSentDate null;
  78.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  79.     private ?\DateTimeImmutable $confirmationEmailSentDate null;
  80.     #[ORM\Column(typeTypes::DATE_IMMUTABLEnullabletrue)]
  81.     private ?\DateTimeImmutable $quoteRequestDate null;
  82.     #[ORM\ManyToOne]
  83.     #[ORM\JoinColumn(nullablefalse)]
  84.     private ?Currency $currency null;
  85.     #[ORM\ManyToMany(targetEntityCommercial::class, inversedBy'bookingEventsAllowed')]
  86.     #[ORM\JoinTable(name"booking_event_commercials_allowed")]
  87.     private Collection $allowedCommercials;
  88.     #[ORM\ManyToMany(targetEntityEmployee::class, inversedBy'bookingEventsAllowed')]
  89.     #[ORM\JoinTable(name"booking_event_employees_allowed")]
  90.     private Collection $allowedEmployees;
  91.     #[ORM\Column(length255nullabletrue)]
  92.     private ?string $addressName null;
  93.     #[ORM\ManyToOne(inversedBy'bookingEvents')]
  94.     private ?BookingEventAddressCategory $addressCategory null;
  95.     #[ORM\Column(nullabletrue)]
  96.     private ?bool $isClosed null;
  97.     #[ORM\Column(nullabletrue)]
  98.     private ?bool $isAdministrativeClosed null;
  99.     #[ORM\Column(nullabletrue)]
  100.     private ?bool $isFinancialClosed null;
  101.     #[ORM\Column(nullabletrue)]
  102.     private ?float $participantPaidAmount null;
  103.     #[ORM\Column(nullabletrue)]
  104.     private ?float $eventTotalEarningsAmount null;
  105.     public function __construct()
  106.     {
  107.         parent::__construct();
  108.         $this->referents          = new ArrayCollection();
  109.         $this->prescriberSpeakers = new ArrayCollection();
  110.         $this->groups             = new ArrayCollection();
  111.         $this->users              = new ArrayCollection();
  112.         $this->files              = new ArrayCollection();
  113.         $this->commercialSpeakers = new ArrayCollection();
  114.         $this->allowedCommercials = new ArrayCollection();
  115.         $this->allowedEmployees   = new ArrayCollection();
  116.     }
  117.     public function __toString(): string
  118.     {
  119.         return $this->getTitle();
  120.     }
  121.     public function getFiles(): Collection
  122.     {
  123.         return $this->files;
  124.     }
  125.     public function addFile(BookingEventFile $file): self
  126.     {
  127.         if (!$this->files->contains($file)) {
  128.             $this->files[] = $file;
  129.             $file->setBookingEvent($this);
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeFile(BookingEventFile $file): self
  134.     {
  135.         if ($this->files->removeElement($file) && $file->getBookingEvent() === $this) {
  136.             $file->setBookingEvent(null);
  137.         }
  138.         return $this;
  139.     }
  140.     public function addAttachment(BookingEventFile $attachment): self
  141.     {
  142.         if (!$this->files->contains($attachment)) {
  143.             $this->files[] = $attachment;
  144.             $attachment->setBookingEvent($this);
  145.         }
  146.         return $this;
  147.     }
  148.     public function removeAttachment(BookingEventFile $attachment): self
  149.     {
  150.         if ($this->files->removeElement($attachment)) {
  151.             // set the owning side to null (unless already changed)
  152.             if ($attachment->getBookingEvent() === $this) {
  153.                 $attachment->setBookingEvent(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158.     public function getDescription(): ?string
  159.     {
  160.         return $this->description;
  161.     }
  162.     public function setDescription(?string $description): static
  163.     {
  164.         $this->description $description;
  165.         return $this;
  166.     }
  167.     public function getRegisteredParticipantCount(): ?int
  168.     {
  169.         return $this->registeredParticipantCount;
  170.     }
  171.     public function setRegisteredParticipantCount(?int $registeredParticipantCount): static
  172.     {
  173.         $this->registeredParticipantCount $registeredParticipantCount;
  174.         return $this;
  175.     }
  176.     public function getActualParticipantCount(): ?int
  177.     {
  178.         return $this->actualParticipantCount;
  179.     }
  180.     public function setActualParticipantCount(?int $actualParticipantCount): static
  181.     {
  182.         $this->actualParticipantCount $actualParticipantCount;
  183.         return $this;
  184.     }
  185.     public function getMaximumCapacity(): ?int
  186.     {
  187.         return $this->maximumCapacity;
  188.     }
  189.     public function setMaximumCapacity(?int $maximumCapacity): static
  190.     {
  191.         $this->maximumCapacity $maximumCapacity;
  192.         return $this;
  193.     }
  194.     public function getEventCost(): ?float
  195.     {
  196.         return $this->eventCost;
  197.     }
  198.     public function setEventCost(?float $eventCost): static
  199.     {
  200.         $this->eventCost $eventCost;
  201.         return $this;
  202.     }
  203.     public function getQuotationStatus(): ?BookingEventQuotationStatus
  204.     {
  205.         return $this->quotationStatus;
  206.     }
  207.     public function setQuotationStatus(?BookingEventQuotationStatus $quotationStatus): static
  208.     {
  209.         $this->quotationStatus $quotationStatus;
  210.         return $this;
  211.     }
  212.     public function getDotationStatus(): ?BookingEventDotationStatus
  213.     {
  214.         return $this->dotationStatus;
  215.     }
  216.     public function setDotationStatus(?BookingEventDotationStatus $dotationStatus): static
  217.     {
  218.         $this->dotationStatus $dotationStatus;
  219.         return $this;
  220.     }
  221.     public function getInvitationStatus(): ?BookingEventInvitationStatus
  222.     {
  223.         return $this->invitationStatus;
  224.     }
  225.     public function setInvitationStatus(?BookingEventInvitationStatus $invitationStatus): static
  226.     {
  227.         $this->invitationStatus $invitationStatus;
  228.         return $this;
  229.     }
  230.     public function getConfirmationMailStatus(): ?BookingEventConfirmationMailStatus
  231.     {
  232.         return $this->confirmationMailStatus;
  233.     }
  234.     public function setConfirmationMailStatus(?BookingEventConfirmationMailStatus $confirmationMailStatus): static
  235.     {
  236.         $this->confirmationMailStatus $confirmationMailStatus;
  237.         return $this;
  238.     }
  239.     /**
  240.      * @return Collection<int, Commercial>
  241.      */
  242.     public function getReferents(): Collection
  243.     {
  244.         return $this->referents;
  245.     }
  246.     public function addCommercial(Commercial $commercial): static
  247.     {
  248.         if (!$this->referents->contains($commercial)) {
  249.             $this->referents->add($commercial);
  250.             $commercial->addBookingEvent($this); // Ajoutez cette ligne
  251.         }
  252.         return $this;
  253.     }
  254.     public function removeCommercial(Commercial $commercial): static
  255.     {
  256.         if ($this->referents->removeElement($commercial)) {
  257.             $commercial->removeBookingEvent($this); // Ajoutez cette ligne
  258.         }
  259.         return $this;
  260.     }
  261.     /**
  262.      * @return Collection<int, Prescriber>
  263.      */
  264.     public function getPrescriberSpeakers(): Collection
  265.     {
  266.         return $this->prescriberSpeakers;
  267.     }
  268.     public function addPrescriber(Prescriber $prescriber): static
  269.     {
  270.         if (!$this->prescriberSpeakers->contains($prescriber)) {
  271.             $this->prescriberSpeakers->add($prescriber);
  272.         }
  273.         return $this;
  274.     }
  275.     public function removePrescriber(Prescriber $prescriber): static
  276.     {
  277.         $this->prescriberSpeakers->removeElement($prescriber);
  278.         return $this;
  279.     }
  280.     /**
  281.      * @return Collection<int, BookingUserGroup>
  282.      */
  283.     public function getGroups(): Collection
  284.     {
  285.         return $this->groups;
  286.     }
  287.     public function addGroup(BookingUserGroup $group): static
  288.     {
  289.         if (!$this->groups->contains($group)) {
  290.             $this->groups->add($group);
  291.         }
  292.         return $this;
  293.     }
  294.     public function removeGroup(BookingUserGroup $group): static
  295.     {
  296.         $this->groups->removeElement($group);
  297.         return $this;
  298.     }
  299.     /**
  300.      * @return Collection<int, User>
  301.      */
  302.     public function getUsers(): Collection
  303.     {
  304.         return $this->users;
  305.     }
  306.     public function addUser(User $user): static
  307.     {
  308.         if (!$this->users->contains($user)) {
  309.             $this->users->add($user);
  310.         }
  311.         return $this;
  312.     }
  313.     public function removeUser(User $user): static
  314.     {
  315.         $this->users->removeElement($user);
  316.         return $this;
  317.     }
  318.     public function getEventCategory(): ?BookingEventCategory
  319.     {
  320.         return $this->eventCategory;
  321.     }
  322.     public function setEventCategory(?BookingEventCategory $eventCategory): static
  323.     {
  324.         $this->eventCategory $eventCategory;
  325.         return $this;
  326.     }
  327.     public function getBookingEventTheme(): ?BookingEventTheme
  328.     {
  329.         return $this->bookingEventTheme;
  330.     }
  331.     public function setBookingEventTheme(?BookingEventTheme $bookingEventTheme): static
  332.     {
  333.         $this->bookingEventTheme $bookingEventTheme;
  334.         return $this;
  335.     }
  336. //    public function setFile(?File $file = null): void
  337. //    {
  338. //        $this->file = $file;
  339. //
  340. //        if (null !== $file) {
  341. //            // Il est nécessaire de mettre Ã  jour l'entité pour que Doctrine Ã©coute les changements
  342. //            $this->updatedAt = new \DateTimeImmutable();
  343. //        }
  344. //    }
  345. //
  346. //    public function getFile(): ?File
  347. //    {
  348. //        return $this->file;
  349. //    }
  350.     public function getAddressLine1(): ?string
  351.     {
  352.         return $this->addressLine1;
  353.     }
  354.     public function setAddressLine1(?string $addressLine1): static
  355.     {
  356.         $this->addressLine1 $addressLine1;
  357.         return $this;
  358.     }
  359.     public function getAddressLine2(): ?string
  360.     {
  361.         return $this->addressLine2;
  362.     }
  363.     public function setAddressLine2(?string $addressLine2): static
  364.     {
  365.         $this->addressLine2 $addressLine2;
  366.         return $this;
  367.     }
  368.     public function getPostalCode(): ?string
  369.     {
  370.         return $this->postalCode;
  371.     }
  372.     public function setPostalCode(?string $postalCode): static
  373.     {
  374.         $this->postalCode $postalCode;
  375.         return $this;
  376.     }
  377.     public function getCity(): ?string
  378.     {
  379.         return $this->city;
  380.     }
  381.     public function setCity(?string $city): static
  382.     {
  383.         $this->city $city;
  384.         return $this;
  385.     }
  386.     public function getCountry(): ?Country
  387.     {
  388.         return $this->country;
  389.     }
  390.     public function setCountry(?Country $country): static
  391.     {
  392.         $this->country $country;
  393.         return $this;
  394.     }
  395.     public function getPhone(): ?string
  396.     {
  397.         return $this->phone;
  398.     }
  399.     public function setPhone(?string $phone): static
  400.     {
  401.         $this->phone $phone;
  402.         return $this;
  403.     }
  404.     public function getInvoiceReceivedDate(): ?\DateTimeImmutable
  405.     {
  406.         return $this->invoiceReceivedDate;
  407.     }
  408.     public function setInvoiceReceivedDate(?\DateTimeImmutable $invoiceReceivedDate): static
  409.     {
  410.         $this->invoiceReceivedDate $invoiceReceivedDate;
  411.         return $this;
  412.     }
  413.     public function getDepositPaidDate(): ?\DateTimeImmutable
  414.     {
  415.         return $this->depositPaidDate;
  416.     }
  417.     public function setDepositPaidDate(?\DateTimeImmutable $depositPaidDate): self
  418.     {
  419.         $this->depositPaidDate $depositPaidDate;
  420.         return $this;
  421.     }
  422.     public function getInvoiceFullyPaidDate(): ?\DateTimeImmutable
  423.     {
  424.         return $this->invoiceFullyPaidDate;
  425.     }
  426.     public function setInvoiceFullyPaidDate(?\DateTimeImmutable $invoiceFullyPaidDate): static
  427.     {
  428.         $this->invoiceFullyPaidDate $invoiceFullyPaidDate;
  429.         return $this;
  430.     }
  431.     public function getQuoteValidatedDate(): ?\DateTimeImmutable
  432.     {
  433.         return $this->quoteValidatedDate;
  434.     }
  435.     public function setQuoteValidatedDate(?\DateTimeImmutable $quoteValidatedDate): static
  436.     {
  437.         $this->quoteValidatedDate $quoteValidatedDate;
  438.         return $this;
  439.     }
  440.     public function getDotationSentDate(): ?\DateTimeImmutable
  441.     {
  442.         return $this->dotationSentDate;
  443.     }
  444.     public function setDotationSentDate(?\DateTimeImmutable $dotationSentDate): static
  445.     {
  446.         $this->dotationSentDate $dotationSentDate;
  447.         return $this;
  448.     }
  449.     public function getInvitationEmailSentDate(): ?\DateTimeImmutable
  450.     {
  451.         return $this->invitationEmailSentDate;
  452.     }
  453.     public function setInvitationEmailSentDate(?\DateTimeImmutable $invitationEmailSentDate): static
  454.     {
  455.         $this->invitationEmailSentDate $invitationEmailSentDate;
  456.         return $this;
  457.     }
  458.     public function getReminderSentDate(): ?\DateTimeImmutable
  459.     {
  460.         return $this->reminderSentDate;
  461.     }
  462.     public function setReminderSentDate(?\DateTimeImmutable $reminderSentDate): static
  463.     {
  464.         $this->reminderSentDate $reminderSentDate;
  465.         return $this;
  466.     }
  467.     public function getConfirmationEmailSentDate(): ?\DateTimeImmutable
  468.     {
  469.         return $this->confirmationEmailSentDate;
  470.     }
  471.     public function setConfirmationEmailSentDate(?\DateTimeImmutable $confirmationEmailSentDate): static
  472.     {
  473.         $this->confirmationEmailSentDate $confirmationEmailSentDate;
  474.         return $this;
  475.     }
  476.     public function getQuoteRequestDate(): ?\DateTimeImmutable
  477.     {
  478.         return $this->quoteRequestDate;
  479.     }
  480.     public function setQuoteRequestDate(?\DateTimeImmutable $quoteRequestDate): static
  481.     {
  482.         $this->quoteRequestDate $quoteRequestDate;
  483.         return $this;
  484.     }
  485.     /**
  486.      * @return Collection<int, Commercial>
  487.      */
  488.     public function getCommercialSpeakers(): Collection
  489.     {
  490.         return $this->commercialSpeakers;
  491.     }
  492.     public function addCommercialSpeaker(Commercial $commercialSpeaker): static
  493.     {
  494.         if (!$this->commercialSpeakers->contains($commercialSpeaker)) {
  495.             $this->commercialSpeakers->add($commercialSpeaker);
  496.         }
  497.         return $this;
  498.     }
  499.     public function removeCommercialSpeaker(Commercial $commercialSpeaker): static
  500.     {
  501.         $this->commercialSpeakers->removeElement($commercialSpeaker);
  502.         return $this;
  503.     }
  504.     public function getCurrency(): ?Currency
  505.     {
  506.         return $this->currency;
  507.     }
  508.     public function setCurrency(?Currency $currency): static
  509.     {
  510.         $this->currency $currency;
  511.         return $this;
  512.     }
  513.     /**
  514.      * @return Collection<int, Commercial>
  515.      */
  516.     public function getAllowedCommercials(): Collection
  517.     {
  518.         return $this->allowedCommercials;
  519.     }
  520.     public function addAllowedCommercial(Commercial $allowedCommercial): static
  521.     {
  522.         if (!$this->allowedCommercials->contains($allowedCommercial)) {
  523.             $this->allowedCommercials->add($allowedCommercial);
  524.         }
  525.         return $this;
  526.     }
  527.     public function removeAllowedCommercial(Commercial $allowedCommercial): static
  528.     {
  529.         $this->allowedCommercials->removeElement($allowedCommercial);
  530.         return $this;
  531.     }
  532.     /**
  533.      * @return Collection<int, Employee>
  534.      */
  535.     public function getAllowedEmployees(): Collection
  536.     {
  537.         return $this->allowedEmployees;
  538.     }
  539.     public function addAllowedEmployee(Employee $allowedEmployee): static
  540.     {
  541.         if (!$this->allowedEmployees->contains($allowedEmployee)) {
  542.             $this->allowedEmployees->add($allowedEmployee);
  543.         }
  544.         return $this;
  545.     }
  546.     public function removeAllowedEmployee(Employee $allowedEmployee): static
  547.     {
  548.         $this->allowedEmployees->removeElement($allowedEmployee);
  549.         return $this;
  550.     }
  551.     public function getAddressName(): ?string
  552.     {
  553.         return $this->addressName;
  554.     }
  555.     public function setAddressName(?string $addressName): static
  556.     {
  557.         $this->addressName $addressName;
  558.         return $this;
  559.     }
  560.     public function getAddressCategory(): ?BookingEventAddressCategory
  561.     {
  562.         return $this->addressCategory;
  563.     }
  564.     public function setAddressCategory(?BookingEventAddressCategory $addressCategory): static
  565.     {
  566.         $this->addressCategory $addressCategory;
  567.         return $this;
  568.     }
  569.     public function isIsClosed(): ?bool
  570.     {
  571.         return $this->isClosed;
  572.     }
  573.     public function setIsClosed(?bool $isClosed): static
  574.     {
  575.         $this->isClosed $isClosed;
  576.         return $this;
  577.     }
  578.     public function isIsAdministrativeClosed(): ?bool
  579.     {
  580.         return $this->isAdministrativeClosed;
  581.     }
  582.     public function setIsAdministrativeClosed(?bool $isAdministrativeClosed): static
  583.     {
  584.         $this->isAdministrativeClosed $isAdministrativeClosed;
  585.         return $this;
  586.     }
  587.     public function isIsFinancialClosed(): ?bool
  588.     {
  589.         return $this->isFinancialClosed;
  590.     }
  591.     public function setIsFinancialClosed(?bool $isFinancialClosed): static
  592.     {
  593.         $this->isFinancialClosed $isFinancialClosed;
  594.         return $this;
  595.     }
  596.     public function getParticipantPaidAmount(): ?float
  597.     {
  598.         return $this->participantPaidAmount;
  599.     }
  600.     public function setParticipantPaidAmount(?float $participantPaidAmount): static
  601.     {
  602.         $this->participantPaidAmount $participantPaidAmount;
  603.         return $this;
  604.     }
  605.     public function getEventTotalEarningsAmount(): ?float
  606.     {
  607.         return $this->eventTotalEarningsAmount;
  608.     }
  609.     public function setEventTotalEarningsAmount(?float $eventTotalEarningsAmount): static
  610.     {
  611.         $this->eventTotalEarningsAmount $eventTotalEarningsAmount;
  612.         return $this;
  613.     }
  614. }