src/Entity/Parameters.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParametersRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. #[ORM\Entity(repositoryClassParametersRepository::class)]
  9. #[Vich\Uploadable]
  10. #[ORM\HasLifecycleCallbacks]
  11. class Parameters
  12. {
  13.     const DEFAULT_SHOOLS = [
  14.         'École maternelle publique du quartier' => 'École maternelle publique du quartier',
  15.         'École primaire publique du quartier' => 'École primaire publique du quartier',
  16.         'Autre école publique' => 'Autre école publique',
  17.         'Établissement privé' => 'Établissement privé',
  18.     ];
  19.     const DEFAULT_REASONS = [
  20.         'Réservation pour les mercredis',
  21.         'Réservations pour les vacances',
  22.         'Autre réservation'
  23.     ];
  24.     const SCHOOL_LEVELS = [
  25.             'PS' => 'Petite section',
  26.             'MS' => 'Moyenne section',
  27.             'GS' => 'Grande section',
  28.             'CP' => 'CP',
  29.             'CE1' => 'CE1',
  30.             'CE2' => 'CE2',
  31.             'CM1' => 'CM1',
  32.             'CM2' => 'CM2',
  33.             '6eme' => 'Sixième',
  34.             '5eme' => 'Cinquième',
  35.             '4eme' => 'Quatrième',
  36.             '3eme' => 'Troisième',
  37.             'Seconde' => 'Seconde',
  38.             'Première' => 'Première',
  39.             'Terminale' => 'Terminale',
  40.             'Autre' => 'Autre'
  41.     ];
  42.     const SCHOOL_SECTION = [
  43.         'PS' => 'Maternelle',
  44.         'MS' => 'Maternelle',
  45.         'GS' => 'Maternelle',
  46.         'CP' => 'Primaire',
  47.         'CE1' => 'Primaire',
  48.         'CE2' => 'Primaire',
  49.         'CM1' => 'Primaire',
  50.         'CM2' => 'Primaire',
  51.         '6eme' => 'Collège',
  52.         '5eme' => 'Collège',
  53.         '4eme' => 'Collège',
  54.         '3eme' => 'Collège',
  55.         'Seconde' => 'Lycée',
  56.         'Première' => 'Lycée',
  57.         'Terminale' => 'Lycée',
  58.         'Autre' => 'Autre'
  59.     ];
  60.     const DEFAULT_SMS_DELAY 1;
  61.     const DEFAULT_SMS_TIME '20:00:00';
  62.     #[ORM\Id]
  63.     #[ORM\GeneratedValue]
  64.     #[ORM\Column]
  65.     private ?int $id null;
  66.     #[ORM\Column(nullabletrue)]
  67.     private ?int $appointmentDuration null;
  68.     #[ORM\Column(length255nullabletrue)]
  69.     private ?string $email null;
  70.     #[ORM\Column(length255nullabletrue)]
  71.     private ?string $name null;
  72.     #[ORM\Column(length255nullabletrue)]
  73.     private ?string $phone null;
  74.     #[ORM\Column(nullabletrue)]
  75.     private ?bool $wantsToReceiveEmail null;
  76.     #[ORM\Column(length255nullabletrue)]
  77.     private ?string $logoFilename null;
  78.     #[Vich\UploadableField(mapping'logo'fileNameProperty'logoFilename')]
  79.     private ?File $logoFile null;
  80.     #[Vich\UploadableField(mapping'attachments'fileNameProperty'mainAttachmentFilename')]
  81.     private ?File $mainAttachmentFile null;
  82.     #[Vich\UploadableField(mapping'attachments'fileNameProperty'secondaryAttachmentFileName')]
  83.     private ?File $secondaryAttachmentFile null;
  84.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  85.     private ?\DateTimeInterface $updatedAt null;
  86.     #[ORM\Column(nullabletrue)]
  87.     private ?int $firstFolderLimit null;
  88.     #[ORM\Column(nullabletrue)]
  89.     private ?int $renewFolderLimit null;
  90.     #[ORM\Column(length255nullabletrue)]
  91.     private ?string $mainAttachmentFilename null;
  92.     #[ORM\Column(length255nullabletrue)]
  93.     private ?string $secondaryAttachmentFileName null;
  94.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  95.     private ?string $attachmentPresentationText null;
  96.     #[ORM\Column(nullabletrue)]
  97.     private ?bool $mustSendSmsNotifications null;
  98.     #[ORM\Column(nullabletrue)]
  99.     private ?int $smsDaysBefore null;
  100.     #[ORM\Column(typeTypes::TIME_MUTABLEnullabletrue)]
  101.     private ?\DateTimeInterface $smsTime null;
  102.     #[ORM\Column(nullabletrue)]
  103.     private ?bool $mustSendEmailNotifications null;
  104.     #[ORM\Column(nullabletrue)]
  105.     private ?int $emailDaysBefore null;
  106.     #[ORM\Column(typeTypes::TIME_MUTABLEnullabletrue)]
  107.     private ?\DateTimeInterface $emailTime null;
  108.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  109.     private ?string $homeMessage null;
  110.     #[ORM\Column(length255nullabletrue)]
  111.     private ?string $address null;
  112.     #[ORM\Column(length10nullabletrue)]
  113.     private ?string $zipCode null;
  114.     #[ORM\Column(length255nullabletrue)]
  115.     private ?string $city null;
  116.     #[ORM\Column(nullabletrue)]
  117.     private ?float $latitude null;
  118.     #[ORM\Column(nullabletrue)]
  119.     private ?float $longitude null;
  120.     #[ORM\Column(length255nullabletrue)]
  121.     private ?string $website null;
  122.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  123.     private ?array $appointmentReasons null;
  124.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  125.     private ?array $schools null;
  126.     #[ORM\Column(nullabletrue)]
  127.     private ?bool $wantsToreceiveEmailOnUndo false;
  128.     #[ORM\Column(length255nullabletrue)]
  129.     private ?string $color 'app';
  130.     public function getId(): ?int
  131.     {
  132.         return $this->id;
  133.     }
  134.     public function getAppointmentDuration(): ?int
  135.     {
  136.         return $this->appointmentDuration;
  137.     }
  138.     public function setAppointmentDuration(?int $appointmentDuration): static
  139.     {
  140.         $this->appointmentDuration $appointmentDuration;
  141.         return $this;
  142.     }
  143.     public function getEmail(): ?string
  144.     {
  145.         return $this->email;
  146.     }
  147.     public function setEmail(?string $email): static
  148.     {
  149.         $this->email $email;
  150.         return $this;
  151.     }
  152.     public function getName(): ?string
  153.     {
  154.         return $this->name;
  155.     }
  156.     public function setName(?string $name): static
  157.     {
  158.         $this->name $name;
  159.         return $this;
  160.     }
  161.     public function getPhone(): ?string
  162.     {
  163.         return $this->phone;
  164.     }
  165.     public function setPhone(?string $phone): static
  166.     {
  167.         $this->phone $phone;
  168.         return $this;
  169.     }
  170.     public function wantsToReceiveEmail(): ?bool
  171.     {
  172.         return $this->wantsToReceiveEmail;
  173.     }
  174.     public function setWantsToReceiveEmail(?bool $wantsToReceiveEmail): static
  175.     {
  176.         $this->wantsToReceiveEmail $wantsToReceiveEmail;
  177.         return $this;
  178.     }
  179.     public function getLogoFilename(): ?string
  180.     {
  181.         return $this->logoFilename;
  182.     }
  183.     public function setLogoFilename(?string $logoFilename): static
  184.     {
  185.         $this->logoFilename $logoFilename;
  186.         return $this;
  187.     }
  188.     public function getUpdatedAt(): ?\DateTimeInterface
  189.     {
  190.         return $this->updatedAt;
  191.     }
  192.     #[ORM\PrePersist]
  193.     public function setUpdatedAt(): static
  194.     {
  195.         $this->updatedAt = new \DateTime();
  196.         return $this;
  197.     }
  198.     public function setLogoFile(?File $logoFile null): void
  199.     {
  200.         $this->logoFile $logoFile;
  201.         if (null !== $logoFile) {
  202.             $this->updatedAt = new \DateTime();
  203.         }
  204.     }
  205.     public function getLogoFile(): ?File
  206.     {
  207.         return $this->logoFile;
  208.     }
  209.     public function getFirstFolderLimit(): ?int
  210.     {
  211.         return $this->firstFolderLimit;
  212.     }
  213.     public function setFirstFolderLimit(?int $firstFolderLimit): static
  214.     {
  215.         $this->firstFolderLimit $firstFolderLimit;
  216.         return $this;
  217.     }
  218.     public function getRenewFolderLimit(): ?int
  219.     {
  220.         return $this->renewFolderLimit;
  221.     }
  222.     public function setRenewFolderLimit(?int $renewFolderLimit): static
  223.     {
  224.         $this->renewFolderLimit $renewFolderLimit;
  225.         return $this;
  226.     }
  227.     public function getMainAttachmentFilename(): ?string
  228.     {
  229.         return $this->mainAttachmentFilename;
  230.     }
  231.     public function setMainAttachmentFilename(?string $mainAttachmentFilename): static
  232.     {
  233.         $this->mainAttachmentFilename $mainAttachmentFilename;
  234.         return $this;
  235.     }
  236.     public function getSecondaryAttachmentFileName(): ?string
  237.     {
  238.         return $this->secondaryAttachmentFileName;
  239.     }
  240.     public function setSecondaryAttachmentFileName(?string $secondaryAttachmentFileName): static
  241.     {
  242.         $this->secondaryAttachmentFileName $secondaryAttachmentFileName;
  243.         return $this;
  244.     }
  245.     public function getAttachmentPresentationText(): ?string
  246.     {
  247.         return $this->attachmentPresentationText;
  248.     }
  249.     public function setAttachmentPresentationText(?string $attachmentPresentationText): static
  250.     {
  251.         $this->attachmentPresentationText $attachmentPresentationText;
  252.         return $this;
  253.     }
  254.     /**
  255.      * @return File|null
  256.      */
  257.     public function getMainAttachmentFile(): ?File
  258.     {
  259.         return $this->mainAttachmentFile;
  260.     }
  261.     /**
  262.      * @param File|null $mainAttachmentFile
  263.      */
  264.     public function setMainAttachmentFile(?File $mainAttachmentFile): void
  265.     {
  266.         $this->mainAttachmentFile $mainAttachmentFile;
  267.         if (null !== $mainAttachmentFile) {
  268.             $this->updatedAt = new \DateTime();
  269.         }
  270.     }
  271.     /**
  272.      * @return File|null
  273.      */
  274.     public function getSecondaryAttachmentFile(): ?File
  275.     {
  276.         return $this->secondaryAttachmentFile;
  277.     }
  278.     /**
  279.      * @param File|null $secondaryAttachmentFile
  280.      */
  281.     public function setSecondaryAttachmentFile(?File $secondaryAttachmentFile): void
  282.     {
  283.         $this->secondaryAttachmentFile $secondaryAttachmentFile;
  284.         if (null !== $secondaryAttachmentFile) {
  285.             $this->updatedAt = new \DateTime();
  286.         }
  287.     }
  288.     public function isMustSendSmsNotifications(): ?bool
  289.     {
  290.         return $this->mustSendSmsNotifications;
  291.     }
  292.     public function setMustSendSmsNotifications(?bool $mustSendSmsNotifications): static
  293.     {
  294.         $this->mustSendSmsNotifications $mustSendSmsNotifications;
  295.         return $this;
  296.     }
  297.     public function getSmsDaysBefore(): ?int
  298.     {
  299.         return $this->smsDaysBefore ?? self::DEFAULT_SMS_DELAY;
  300.     }
  301.     public function setSmsDaysBefore(?int $smsDaysBefore): static
  302.     {
  303.         $this->smsDaysBefore $smsDaysBefore;
  304.         return $this;
  305.     }
  306.     public function getSmsTime(): ?\DateTimeInterface
  307.     {
  308.         return $this->smsTime ?? new \DateTime(self::DEFAULT_SMS_TIME);
  309.     }
  310.     public function setSmsTime(?\DateTimeInterface $smsTime): static
  311.     {
  312.         $this->smsTime $smsTime;
  313.         return $this;
  314.     }
  315.     public function isMustSendEmailNotifications(): ?bool
  316.     {
  317.         return $this->mustSendEmailNotifications;
  318.     }
  319.     public function setMustSendEmailNotifications(?bool $mustSendEmailNotifications): static
  320.     {
  321.         $this->mustSendEmailNotifications $mustSendEmailNotifications;
  322.         return $this;
  323.     }
  324.     public function getEmailDaysBefore(): ?int
  325.     {
  326.         return $this->emailDaysBefore;
  327.     }
  328.     public function setEmailDaysBefore(?int $emailDaysBefore): static
  329.     {
  330.         $this->emailDaysBefore $emailDaysBefore;
  331.         return $this;
  332.     }
  333.     public function getEmailTime(): ?\DateTimeInterface
  334.     {
  335.         return $this->emailTime;
  336.     }
  337.     public function setEmailTime(?\DateTimeInterface $emailTime): static
  338.     {
  339.         $this->emailTime $emailTime;
  340.         return $this;
  341.     }
  342.     public function getHomeMessage(): string
  343.     {
  344.         return $this->homeMessage ?? '';
  345.     }
  346.     public function setHomeMessage(?string $homeMessage): static
  347.     {
  348.         $this->homeMessage $homeMessage;
  349.         return $this;
  350.     }
  351.     public function hasMinimumNecessary(): bool
  352.     {
  353.         return
  354.             $this->name &&
  355.             $this->phone &&
  356.             $this->email &&
  357.             $this->appointmentDuration
  358.             ;
  359.     }
  360.     public function getAddress(): ?string
  361.     {
  362.         return $this->address;
  363.     }
  364.     public function setAddress(?string $address): static
  365.     {
  366.         $this->address $address;
  367.         return $this;
  368.     }
  369.     public function getZipCode(): ?string
  370.     {
  371.         return $this->zipCode;
  372.     }
  373.     public function setZipCode(?string $zipCode): static
  374.     {
  375.         $this->zipCode $zipCode;
  376.         return $this;
  377.     }
  378.     public function getCity(): ?string
  379.     {
  380.         return $this->city;
  381.     }
  382.     public function setCity(?string $city): static
  383.     {
  384.         $this->city $city;
  385.         return $this;
  386.     }
  387.     public function getLatitude(): ?float
  388.     {
  389.         return $this->latitude;
  390.     }
  391.     public function setLatitude(?float $latitude): static
  392.     {
  393.         $this->latitude $latitude;
  394.         return $this;
  395.     }
  396.     public function getLongitude(): ?float
  397.     {
  398.         return $this->longitude;
  399.     }
  400.     public function setLongitude(?float $longitude): static
  401.     {
  402.         $this->longitude $longitude;
  403.         return $this;
  404.     }
  405.     public function getWebsite(): ?string
  406.     {
  407.         return $this->website;
  408.     }
  409.     public function setWebsite(?string $website): static
  410.     {
  411.         $this->website $website;
  412.         return $this;
  413.     }
  414.     public function getAppointmentReasons(): ?array
  415.     {
  416.         return $this->appointmentReasons;
  417.     }
  418.     public function setAppointmentReasons(?array $appointmentReasons): static
  419.     {
  420.         $this->appointmentReasons $appointmentReasons;
  421.         return $this;
  422.     }
  423.     public function getSchools(): ?array
  424.     {
  425.         return $this->schools;
  426.     }
  427.     public function setSchools(?array $schools): static
  428.     {
  429.         $this->schools $schools;
  430.         return $this;
  431.     }
  432.     public function isWantsToreceiveEmailOnUndo(): ?bool
  433.     {
  434.         return $this->wantsToreceiveEmailOnUndo;
  435.     }
  436.     public function setWantsToreceiveEmailOnUndo(?bool $wantsToreceiveEmailOnUndo): static
  437.     {
  438.         $this->wantsToreceiveEmailOnUndo $wantsToreceiveEmailOnUndo;
  439.         return $this;
  440.     }
  441.     public function getColor(): ?string
  442.     {
  443.         return $this->color;
  444.     }
  445.     public function setColor(?string $color): static
  446.     {
  447.         $this->color $color;
  448.         return $this;
  449.     }
  450. }