<?php
namespace App\Entity;
use App\Repository\ParametersRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: ParametersRepository::class)]
#[Vich\Uploadable]
#[ORM\HasLifecycleCallbacks]
class Parameters
{
const DEFAULT_SHOOLS = [
'École maternelle publique du quartier' => 'École maternelle publique du quartier',
'École primaire publique du quartier' => 'École primaire publique du quartier',
'Autre école publique' => 'Autre école publique',
'Établissement privé' => 'Établissement privé',
];
const DEFAULT_REASONS = [
'Réservation pour les mercredis',
'Réservations pour les vacances',
'Autre réservation'
];
const SCHOOL_LEVELS = [
'PS' => 'Petite section',
'MS' => 'Moyenne section',
'GS' => 'Grande section',
'CP' => 'CP',
'CE1' => 'CE1',
'CE2' => 'CE2',
'CM1' => 'CM1',
'CM2' => 'CM2',
'6eme' => 'Sixième',
'5eme' => 'Cinquième',
'4eme' => 'Quatrième',
'3eme' => 'Troisième',
'Seconde' => 'Seconde',
'Première' => 'Première',
'Terminale' => 'Terminale',
'Autre' => 'Autre'
];
const SCHOOL_SECTION = [
'PS' => 'Maternelle',
'MS' => 'Maternelle',
'GS' => 'Maternelle',
'CP' => 'Primaire',
'CE1' => 'Primaire',
'CE2' => 'Primaire',
'CM1' => 'Primaire',
'CM2' => 'Primaire',
'6eme' => 'Collège',
'5eme' => 'Collège',
'4eme' => 'Collège',
'3eme' => 'Collège',
'Seconde' => 'Lycée',
'Première' => 'Lycée',
'Terminale' => 'Lycée',
'Autre' => 'Autre'
];
const DEFAULT_SMS_DELAY = 1;
const DEFAULT_SMS_TIME = '20:00:00';
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(nullable: true)]
private ?int $appointmentDuration = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $phone = null;
#[ORM\Column(nullable: true)]
private ?bool $wantsToReceiveEmail = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $logoFilename = null;
#[Vich\UploadableField(mapping: 'logo', fileNameProperty: 'logoFilename')]
private ?File $logoFile = null;
#[Vich\UploadableField(mapping: 'attachments', fileNameProperty: 'mainAttachmentFilename')]
private ?File $mainAttachmentFile = null;
#[Vich\UploadableField(mapping: 'attachments', fileNameProperty: 'secondaryAttachmentFileName')]
private ?File $secondaryAttachmentFile = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $updatedAt = null;
#[ORM\Column(nullable: true)]
private ?int $firstFolderLimit = null;
#[ORM\Column(nullable: true)]
private ?int $renewFolderLimit = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $mainAttachmentFilename = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $secondaryAttachmentFileName = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $attachmentPresentationText = null;
#[ORM\Column(nullable: true)]
private ?bool $mustSendSmsNotifications = null;
#[ORM\Column(nullable: true)]
private ?int $smsDaysBefore = null;
#[ORM\Column(type: Types::TIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $smsTime = null;
#[ORM\Column(nullable: true)]
private ?bool $mustSendEmailNotifications = null;
#[ORM\Column(nullable: true)]
private ?int $emailDaysBefore = null;
#[ORM\Column(type: Types::TIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $emailTime = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $homeMessage = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $address = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $zipCode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\Column(nullable: true)]
private ?float $latitude = null;
#[ORM\Column(nullable: true)]
private ?float $longitude = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $website = null;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
private ?array $appointmentReasons = null;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
private ?array $schools = null;
#[ORM\Column(nullable: true)]
private ?bool $wantsToreceiveEmailOnUndo = false;
#[ORM\Column(length: 255, nullable: true)]
private ?string $color = 'app';
public function getId(): ?int
{
return $this->id;
}
public function getAppointmentDuration(): ?int
{
return $this->appointmentDuration;
}
public function setAppointmentDuration(?int $appointmentDuration): static
{
$this->appointmentDuration = $appointmentDuration;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): static
{
$this->email = $email;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): static
{
$this->name = $name;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): static
{
$this->phone = $phone;
return $this;
}
public function wantsToReceiveEmail(): ?bool
{
return $this->wantsToReceiveEmail;
}
public function setWantsToReceiveEmail(?bool $wantsToReceiveEmail): static
{
$this->wantsToReceiveEmail = $wantsToReceiveEmail;
return $this;
}
public function getLogoFilename(): ?string
{
return $this->logoFilename;
}
public function setLogoFilename(?string $logoFilename): static
{
$this->logoFilename = $logoFilename;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
#[ORM\PrePersist]
public function setUpdatedAt(): static
{
$this->updatedAt = new \DateTime();
return $this;
}
public function setLogoFile(?File $logoFile = null): void
{
$this->logoFile = $logoFile;
if (null !== $logoFile) {
$this->updatedAt = new \DateTime();
}
}
public function getLogoFile(): ?File
{
return $this->logoFile;
}
public function getFirstFolderLimit(): ?int
{
return $this->firstFolderLimit;
}
public function setFirstFolderLimit(?int $firstFolderLimit): static
{
$this->firstFolderLimit = $firstFolderLimit;
return $this;
}
public function getRenewFolderLimit(): ?int
{
return $this->renewFolderLimit;
}
public function setRenewFolderLimit(?int $renewFolderLimit): static
{
$this->renewFolderLimit = $renewFolderLimit;
return $this;
}
public function getMainAttachmentFilename(): ?string
{
return $this->mainAttachmentFilename;
}
public function setMainAttachmentFilename(?string $mainAttachmentFilename): static
{
$this->mainAttachmentFilename = $mainAttachmentFilename;
return $this;
}
public function getSecondaryAttachmentFileName(): ?string
{
return $this->secondaryAttachmentFileName;
}
public function setSecondaryAttachmentFileName(?string $secondaryAttachmentFileName): static
{
$this->secondaryAttachmentFileName = $secondaryAttachmentFileName;
return $this;
}
public function getAttachmentPresentationText(): ?string
{
return $this->attachmentPresentationText;
}
public function setAttachmentPresentationText(?string $attachmentPresentationText): static
{
$this->attachmentPresentationText = $attachmentPresentationText;
return $this;
}
/**
* @return File|null
*/
public function getMainAttachmentFile(): ?File
{
return $this->mainAttachmentFile;
}
/**
* @param File|null $mainAttachmentFile
*/
public function setMainAttachmentFile(?File $mainAttachmentFile): void
{
$this->mainAttachmentFile = $mainAttachmentFile;
if (null !== $mainAttachmentFile) {
$this->updatedAt = new \DateTime();
}
}
/**
* @return File|null
*/
public function getSecondaryAttachmentFile(): ?File
{
return $this->secondaryAttachmentFile;
}
/**
* @param File|null $secondaryAttachmentFile
*/
public function setSecondaryAttachmentFile(?File $secondaryAttachmentFile): void
{
$this->secondaryAttachmentFile = $secondaryAttachmentFile;
if (null !== $secondaryAttachmentFile) {
$this->updatedAt = new \DateTime();
}
}
public function isMustSendSmsNotifications(): ?bool
{
return $this->mustSendSmsNotifications;
}
public function setMustSendSmsNotifications(?bool $mustSendSmsNotifications): static
{
$this->mustSendSmsNotifications = $mustSendSmsNotifications;
return $this;
}
public function getSmsDaysBefore(): ?int
{
return $this->smsDaysBefore ?? self::DEFAULT_SMS_DELAY;
}
public function setSmsDaysBefore(?int $smsDaysBefore): static
{
$this->smsDaysBefore = $smsDaysBefore;
return $this;
}
public function getSmsTime(): ?\DateTimeInterface
{
return $this->smsTime ?? new \DateTime(self::DEFAULT_SMS_TIME);
}
public function setSmsTime(?\DateTimeInterface $smsTime): static
{
$this->smsTime = $smsTime;
return $this;
}
public function isMustSendEmailNotifications(): ?bool
{
return $this->mustSendEmailNotifications;
}
public function setMustSendEmailNotifications(?bool $mustSendEmailNotifications): static
{
$this->mustSendEmailNotifications = $mustSendEmailNotifications;
return $this;
}
public function getEmailDaysBefore(): ?int
{
return $this->emailDaysBefore;
}
public function setEmailDaysBefore(?int $emailDaysBefore): static
{
$this->emailDaysBefore = $emailDaysBefore;
return $this;
}
public function getEmailTime(): ?\DateTimeInterface
{
return $this->emailTime;
}
public function setEmailTime(?\DateTimeInterface $emailTime): static
{
$this->emailTime = $emailTime;
return $this;
}
public function getHomeMessage(): string
{
return $this->homeMessage ?? '';
}
public function setHomeMessage(?string $homeMessage): static
{
$this->homeMessage = $homeMessage;
return $this;
}
public function hasMinimumNecessary(): bool
{
return
$this->name &&
$this->phone &&
$this->email &&
$this->appointmentDuration
;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): static
{
$this->address = $address;
return $this;
}
public function getZipCode(): ?string
{
return $this->zipCode;
}
public function setZipCode(?string $zipCode): static
{
$this->zipCode = $zipCode;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): static
{
$this->city = $city;
return $this;
}
public function getLatitude(): ?float
{
return $this->latitude;
}
public function setLatitude(?float $latitude): static
{
$this->latitude = $latitude;
return $this;
}
public function getLongitude(): ?float
{
return $this->longitude;
}
public function setLongitude(?float $longitude): static
{
$this->longitude = $longitude;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): static
{
$this->website = $website;
return $this;
}
public function getAppointmentReasons(): ?array
{
return $this->appointmentReasons;
}
public function setAppointmentReasons(?array $appointmentReasons): static
{
$this->appointmentReasons = $appointmentReasons;
return $this;
}
public function getSchools(): ?array
{
return $this->schools;
}
public function setSchools(?array $schools): static
{
$this->schools = $schools;
return $this;
}
public function isWantsToreceiveEmailOnUndo(): ?bool
{
return $this->wantsToreceiveEmailOnUndo;
}
public function setWantsToreceiveEmailOnUndo(?bool $wantsToreceiveEmailOnUndo): static
{
$this->wantsToreceiveEmailOnUndo = $wantsToreceiveEmailOnUndo;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): static
{
$this->color = $color;
return $this;
}
}