<?php
namespace App\Entity;
use App\Repository\BookingEventRepository;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: BookingEventRepository::class)]
#[Vich\Uploadable]
class BookingEvent extends Booking
{
use IdentifiableTrait;
#[ORM\OneToMany(mappedBy: 'bookingEvent', targetEntity: BookingEventFile::class, cascade: ['persist'])]
private $files;
#[ORM\Column(type: 'datetime_immutable')]
private \DateTimeImmutable $updatedAt;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(nullable: true)]
private ?int $registeredParticipantCount = null;
#[ORM\Column(nullable: true)]
private ?int $actualParticipantCount = null;
#[ORM\Column(nullable: true)]
private ?int $maximumCapacity = null;
#[ORM\Column(nullable: true)]
private ?float $eventCost = null;
#[ORM\ManyToOne(inversedBy: 'bookingEvents')]
private ?BookingEventQuotationStatus $quotationStatus = null;
#[ORM\ManyToOne(inversedBy: 'bookingEvents')]
private ?BookingEventDotationStatus $dotationStatus = null;
#[ORM\ManyToOne(inversedBy: 'bookingEvents')]
private ?BookingEventInvitationStatus $invitationStatus = null;
#[ORM\ManyToOne(inversedBy: 'bookingEvents')]
private ?BookingEventConfirmationMailStatus $confirmationMailStatus = null;
#[ORM\ManyToMany(targetEntity: Commercial::class, inversedBy: 'referentsBookingEvents')]
#[ORM\JoinTable(name: "booking_event_referent")]
private Collection $referents;
#[ORM\ManyToMany(targetEntity: Prescriber::class, inversedBy: 'prescriberSpeakersBookingEvents')]
private Collection $prescriberSpeakers;
#[ORM\ManyToMany(targetEntity: Commercial::class, inversedBy: 'commercialSpeakersBookingEvents')]
#[ORM\JoinTable(name: "booking_event_commercial_speaker")]
private Collection $commercialSpeakers;
#[ORM\ManyToMany(targetEntity: BookingUserGroup::class, inversedBy: 'bookingEvents')]
private Collection $groups;
#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'bookingEvents')]
private Collection $users;
#[ORM\ManyToOne(inversedBy: 'bookingEvents')]
private ?BookingEventCategory $eventCategory = null;
#[ORM\ManyToOne(inversedBy: 'bookingEvents')]
private ?BookingEventTheme $bookingEventTheme = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $addressLine1 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $addressLine2 = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $postalCode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\ManyToOne]
private ?Country $country = null;
#[ORM\Column(length: 50, nullable: true)]
private ?string $phone = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $invoiceReceivedDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $depositPaidDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $invoiceFullyPaidDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $quoteValidatedDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $dotationSentDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $invitationEmailSentDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $reminderSentDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $confirmationEmailSentDate = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $quoteRequestDate = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Currency $currency = null;
#[ORM\ManyToMany(targetEntity: Commercial::class, inversedBy: 'bookingEventsAllowed')]
#[ORM\JoinTable(name: "booking_event_commercials_allowed")]
private Collection $allowedCommercials;
#[ORM\ManyToMany(targetEntity: Employee::class, inversedBy: 'bookingEventsAllowed')]
#[ORM\JoinTable(name: "booking_event_employees_allowed")]
private Collection $allowedEmployees;
#[ORM\Column(length: 255, nullable: true)]
private ?string $addressName = null;
#[ORM\ManyToOne(inversedBy: 'bookingEvents')]
private ?BookingEventAddressCategory $addressCategory = null;
#[ORM\Column(nullable: true)]
private ?bool $isClosed = null;
#[ORM\Column(nullable: true)]
private ?bool $isAdministrativeClosed = null;
#[ORM\Column(nullable: true)]
private ?bool $isFinancialClosed = null;
#[ORM\Column(nullable: true)]
private ?float $participantPaidAmount = null;
#[ORM\Column(nullable: true)]
private ?float $eventTotalEarningsAmount = null;
public function __construct()
{
parent::__construct();
$this->referents = new ArrayCollection();
$this->prescriberSpeakers = new ArrayCollection();
$this->groups = new ArrayCollection();
$this->users = new ArrayCollection();
$this->files = new ArrayCollection();
$this->commercialSpeakers = new ArrayCollection();
$this->allowedCommercials = new ArrayCollection();
$this->allowedEmployees = new ArrayCollection();
}
public function __toString(): string
{
return $this->getTitle();
}
public function getFiles(): Collection
{
return $this->files;
}
public function addFile(BookingEventFile $file): self
{
if (!$this->files->contains($file)) {
$this->files[] = $file;
$file->setBookingEvent($this);
}
return $this;
}
public function removeFile(BookingEventFile $file): self
{
if ($this->files->removeElement($file) && $file->getBookingEvent() === $this) {
$file->setBookingEvent(null);
}
return $this;
}
public function addAttachment(BookingEventFile $attachment): self
{
if (!$this->files->contains($attachment)) {
$this->files[] = $attachment;
$attachment->setBookingEvent($this);
}
return $this;
}
public function removeAttachment(BookingEventFile $attachment): self
{
if ($this->files->removeElement($attachment)) {
// set the owning side to null (unless already changed)
if ($attachment->getBookingEvent() === $this) {
$attachment->setBookingEvent(null);
}
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getRegisteredParticipantCount(): ?int
{
return $this->registeredParticipantCount;
}
public function setRegisteredParticipantCount(?int $registeredParticipantCount): static
{
$this->registeredParticipantCount = $registeredParticipantCount;
return $this;
}
public function getActualParticipantCount(): ?int
{
return $this->actualParticipantCount;
}
public function setActualParticipantCount(?int $actualParticipantCount): static
{
$this->actualParticipantCount = $actualParticipantCount;
return $this;
}
public function getMaximumCapacity(): ?int
{
return $this->maximumCapacity;
}
public function setMaximumCapacity(?int $maximumCapacity): static
{
$this->maximumCapacity = $maximumCapacity;
return $this;
}
public function getEventCost(): ?float
{
return $this->eventCost;
}
public function setEventCost(?float $eventCost): static
{
$this->eventCost = $eventCost;
return $this;
}
public function getQuotationStatus(): ?BookingEventQuotationStatus
{
return $this->quotationStatus;
}
public function setQuotationStatus(?BookingEventQuotationStatus $quotationStatus): static
{
$this->quotationStatus = $quotationStatus;
return $this;
}
public function getDotationStatus(): ?BookingEventDotationStatus
{
return $this->dotationStatus;
}
public function setDotationStatus(?BookingEventDotationStatus $dotationStatus): static
{
$this->dotationStatus = $dotationStatus;
return $this;
}
public function getInvitationStatus(): ?BookingEventInvitationStatus
{
return $this->invitationStatus;
}
public function setInvitationStatus(?BookingEventInvitationStatus $invitationStatus): static
{
$this->invitationStatus = $invitationStatus;
return $this;
}
public function getConfirmationMailStatus(): ?BookingEventConfirmationMailStatus
{
return $this->confirmationMailStatus;
}
public function setConfirmationMailStatus(?BookingEventConfirmationMailStatus $confirmationMailStatus): static
{
$this->confirmationMailStatus = $confirmationMailStatus;
return $this;
}
/**
* @return Collection<int, Commercial>
*/
public function getReferents(): Collection
{
return $this->referents;
}
public function addCommercial(Commercial $commercial): static
{
if (!$this->referents->contains($commercial)) {
$this->referents->add($commercial);
$commercial->addBookingEvent($this); // Ajoutez cette ligne
}
return $this;
}
public function removeCommercial(Commercial $commercial): static
{
if ($this->referents->removeElement($commercial)) {
$commercial->removeBookingEvent($this); // Ajoutez cette ligne
}
return $this;
}
/**
* @return Collection<int, Prescriber>
*/
public function getPrescriberSpeakers(): Collection
{
return $this->prescriberSpeakers;
}
public function addPrescriber(Prescriber $prescriber): static
{
if (!$this->prescriberSpeakers->contains($prescriber)) {
$this->prescriberSpeakers->add($prescriber);
}
return $this;
}
public function removePrescriber(Prescriber $prescriber): static
{
$this->prescriberSpeakers->removeElement($prescriber);
return $this;
}
/**
* @return Collection<int, BookingUserGroup>
*/
public function getGroups(): Collection
{
return $this->groups;
}
public function addGroup(BookingUserGroup $group): static
{
if (!$this->groups->contains($group)) {
$this->groups->add($group);
}
return $this;
}
public function removeGroup(BookingUserGroup $group): static
{
$this->groups->removeElement($group);
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): static
{
if (!$this->users->contains($user)) {
$this->users->add($user);
}
return $this;
}
public function removeUser(User $user): static
{
$this->users->removeElement($user);
return $this;
}
public function getEventCategory(): ?BookingEventCategory
{
return $this->eventCategory;
}
public function setEventCategory(?BookingEventCategory $eventCategory): static
{
$this->eventCategory = $eventCategory;
return $this;
}
public function getBookingEventTheme(): ?BookingEventTheme
{
return $this->bookingEventTheme;
}
public function setBookingEventTheme(?BookingEventTheme $bookingEventTheme): static
{
$this->bookingEventTheme = $bookingEventTheme;
return $this;
}
// public function setFile(?File $file = null): void
// {
// $this->file = $file;
//
// if (null !== $file) {
// // Il est nécessaire de mettre à jour l'entité pour que Doctrine écoute les changements
// $this->updatedAt = new \DateTimeImmutable();
// }
// }
//
// public function getFile(): ?File
// {
// return $this->file;
// }
public function getAddressLine1(): ?string
{
return $this->addressLine1;
}
public function setAddressLine1(?string $addressLine1): static
{
$this->addressLine1 = $addressLine1;
return $this;
}
public function getAddressLine2(): ?string
{
return $this->addressLine2;
}
public function setAddressLine2(?string $addressLine2): static
{
$this->addressLine2 = $addressLine2;
return $this;
}
public function getPostalCode(): ?string
{
return $this->postalCode;
}
public function setPostalCode(?string $postalCode): static
{
$this->postalCode = $postalCode;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): static
{
$this->city = $city;
return $this;
}
public function getCountry(): ?Country
{
return $this->country;
}
public function setCountry(?Country $country): static
{
$this->country = $country;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): static
{
$this->phone = $phone;
return $this;
}
public function getInvoiceReceivedDate(): ?\DateTimeImmutable
{
return $this->invoiceReceivedDate;
}
public function setInvoiceReceivedDate(?\DateTimeImmutable $invoiceReceivedDate): static
{
$this->invoiceReceivedDate = $invoiceReceivedDate;
return $this;
}
public function getDepositPaidDate(): ?\DateTimeImmutable
{
return $this->depositPaidDate;
}
public function setDepositPaidDate(?\DateTimeImmutable $depositPaidDate): self
{
$this->depositPaidDate = $depositPaidDate;
return $this;
}
public function getInvoiceFullyPaidDate(): ?\DateTimeImmutable
{
return $this->invoiceFullyPaidDate;
}
public function setInvoiceFullyPaidDate(?\DateTimeImmutable $invoiceFullyPaidDate): static
{
$this->invoiceFullyPaidDate = $invoiceFullyPaidDate;
return $this;
}
public function getQuoteValidatedDate(): ?\DateTimeImmutable
{
return $this->quoteValidatedDate;
}
public function setQuoteValidatedDate(?\DateTimeImmutable $quoteValidatedDate): static
{
$this->quoteValidatedDate = $quoteValidatedDate;
return $this;
}
public function getDotationSentDate(): ?\DateTimeImmutable
{
return $this->dotationSentDate;
}
public function setDotationSentDate(?\DateTimeImmutable $dotationSentDate): static
{
$this->dotationSentDate = $dotationSentDate;
return $this;
}
public function getInvitationEmailSentDate(): ?\DateTimeImmutable
{
return $this->invitationEmailSentDate;
}
public function setInvitationEmailSentDate(?\DateTimeImmutable $invitationEmailSentDate): static
{
$this->invitationEmailSentDate = $invitationEmailSentDate;
return $this;
}
public function getReminderSentDate(): ?\DateTimeImmutable
{
return $this->reminderSentDate;
}
public function setReminderSentDate(?\DateTimeImmutable $reminderSentDate): static
{
$this->reminderSentDate = $reminderSentDate;
return $this;
}
public function getConfirmationEmailSentDate(): ?\DateTimeImmutable
{
return $this->confirmationEmailSentDate;
}
public function setConfirmationEmailSentDate(?\DateTimeImmutable $confirmationEmailSentDate): static
{
$this->confirmationEmailSentDate = $confirmationEmailSentDate;
return $this;
}
public function getQuoteRequestDate(): ?\DateTimeImmutable
{
return $this->quoteRequestDate;
}
public function setQuoteRequestDate(?\DateTimeImmutable $quoteRequestDate): static
{
$this->quoteRequestDate = $quoteRequestDate;
return $this;
}
/**
* @return Collection<int, Commercial>
*/
public function getCommercialSpeakers(): Collection
{
return $this->commercialSpeakers;
}
public function addCommercialSpeaker(Commercial $commercialSpeaker): static
{
if (!$this->commercialSpeakers->contains($commercialSpeaker)) {
$this->commercialSpeakers->add($commercialSpeaker);
}
return $this;
}
public function removeCommercialSpeaker(Commercial $commercialSpeaker): static
{
$this->commercialSpeakers->removeElement($commercialSpeaker);
return $this;
}
public function getCurrency(): ?Currency
{
return $this->currency;
}
public function setCurrency(?Currency $currency): static
{
$this->currency = $currency;
return $this;
}
/**
* @return Collection<int, Commercial>
*/
public function getAllowedCommercials(): Collection
{
return $this->allowedCommercials;
}
public function addAllowedCommercial(Commercial $allowedCommercial): static
{
if (!$this->allowedCommercials->contains($allowedCommercial)) {
$this->allowedCommercials->add($allowedCommercial);
}
return $this;
}
public function removeAllowedCommercial(Commercial $allowedCommercial): static
{
$this->allowedCommercials->removeElement($allowedCommercial);
return $this;
}
/**
* @return Collection<int, Employee>
*/
public function getAllowedEmployees(): Collection
{
return $this->allowedEmployees;
}
public function addAllowedEmployee(Employee $allowedEmployee): static
{
if (!$this->allowedEmployees->contains($allowedEmployee)) {
$this->allowedEmployees->add($allowedEmployee);
}
return $this;
}
public function removeAllowedEmployee(Employee $allowedEmployee): static
{
$this->allowedEmployees->removeElement($allowedEmployee);
return $this;
}
public function getAddressName(): ?string
{
return $this->addressName;
}
public function setAddressName(?string $addressName): static
{
$this->addressName = $addressName;
return $this;
}
public function getAddressCategory(): ?BookingEventAddressCategory
{
return $this->addressCategory;
}
public function setAddressCategory(?BookingEventAddressCategory $addressCategory): static
{
$this->addressCategory = $addressCategory;
return $this;
}
public function isIsClosed(): ?bool
{
return $this->isClosed;
}
public function setIsClosed(?bool $isClosed): static
{
$this->isClosed = $isClosed;
return $this;
}
public function isIsAdministrativeClosed(): ?bool
{
return $this->isAdministrativeClosed;
}
public function setIsAdministrativeClosed(?bool $isAdministrativeClosed): static
{
$this->isAdministrativeClosed = $isAdministrativeClosed;
return $this;
}
public function isIsFinancialClosed(): ?bool
{
return $this->isFinancialClosed;
}
public function setIsFinancialClosed(?bool $isFinancialClosed): static
{
$this->isFinancialClosed = $isFinancialClosed;
return $this;
}
public function getParticipantPaidAmount(): ?float
{
return $this->participantPaidAmount;
}
public function setParticipantPaidAmount(?float $participantPaidAmount): static
{
$this->participantPaidAmount = $participantPaidAmount;
return $this;
}
public function getEventTotalEarningsAmount(): ?float
{
return $this->eventTotalEarningsAmount;
}
public function setEventTotalEarningsAmount(?float $eventTotalEarningsAmount): static
{
$this->eventTotalEarningsAmount = $eventTotalEarningsAmount;
return $this;
}
}