src/Entity/EditionPlanification.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Controller\PlanificationController;
  7. use App\Repository\EditionPlanificationRepository;
  8. use App\Service\PlanificationService;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. /**
  11.  * @ORM\Entity(repositoryClass="App\Repository\EditionPlanificationRepository")
  12.  */
  13. class EditionPlanification
  14. {
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\Selection", inversedBy="planifications")
  27.      * @ORM\JoinColumn(name="selection_id", referencedColumnName="id", nullable=false)
  28.      */
  29.     private $selection;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\EditionModele", inversedBy="planifications")
  32.      * @ORM\JoinColumn(name="modele_id", referencedColumnName="id", nullable=false)
  33.      */
  34.     private $modele;
  35.     /**
  36.      * @ORM\Column(type="string", length=50, nullable=true, options={"comment":"Type d'export (`PDF_UNIQUE`, `FICHE_PDF`, `FICHE_PDF_ZIP`, `FICHE_JPG`, `PAGE_JPG`)"})
  37.      */
  38.     private $exportMode;
  39.     /**
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      */
  42.     private $frequence;
  43.     /**
  44.      * @ORM\Column(type="json", nullable=true, options={"comment":"jour et heure (ou seulement heure)"})
  45.      */
  46.     private $time;
  47.     /**
  48.      * @ORM\Column(type="string", nullable=true)
  49.      */
  50.     private $texteVolee;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $email;
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=true)
  57.      */
  58.     private $sendByEmail;
  59.     /**
  60.      * @ORM\Column(type="string", length=5, nullable=true, options={"comment":"Type de réception (`EMAIL`, `FTP` ou `LIEN`)"})
  61.      */
  62.     private $receptionType;
  63.     /**
  64.      * @ORM\Column(type="json", nullable=true)
  65.      */
  66.     private $ftpData;
  67.     /**
  68.      * @ORM\Column(type="datetime", nullable=true, options={"comment":"Prochaine date de traitement de la tâche"})
  69.      */
  70.     private $dueDate;
  71.     /**
  72.      * @ORM\Column(type="boolean", nullable=true)
  73.      */
  74.     private $enableNotifications true;
  75.     /**
  76.      * @ORM\Column(type="string", length=255, nullable=true)
  77.      */
  78.     private $lang 'fr';
  79.     /**
  80.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="editionPlanifications")
  81.      */
  82.     private $owner;
  83.     /**
  84.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="editionPlanifications")
  85.      */
  86.     private $entity;
  87.     /**
  88.      * @ORM\Column(type="datetime", nullable=true)
  89.      */
  90.     private $createdAt;
  91.     /**
  92.      * @ORM\Column(type="datetime", nullable=true)
  93.      */
  94.     private $updatedAt;
  95.     /**
  96.      * @ORM\Column(type="integer", nullable=true)
  97.      */
  98.     private $state;
  99.     /**
  100.      * @ORM\Column(type="boolean", options={"default": false})
  101.      */
  102.     private $disabled;
  103.     /**
  104.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Lien permanent pour le téléchargement du fichier"})
  105.      */
  106.     private $permanentFilename;
  107.     /**
  108.      * @ORM\Column(type="boolean", nullable=true, options={"default": false})
  109.      */
  110.     private $modeGuideAccueil;
  111.     /**
  112.      * @ORM\ManyToOne(targetEntity="App\Entity\Selection", inversedBy="guidesAccueilPlanifications")
  113.      * @ORM\JoinColumn(name="selection_guide_accueil_id", referencedColumnName="id", nullable=true )
  114.      */
  115.     private $selectionGuideAccueil;
  116.     /**
  117.      * @ORM\Column(type="integer", nullable=true)
  118.      */
  119.     private $rayonGuideAccueil;
  120.     /**
  121.      * @ORM\Column(type="string", nullable=true, options={"comment":"FIltre (`RAYON` ou `VILLE`)"})
  122.      */
  123.     private $filterGuideAccueil;
  124.     /**
  125.      * @var \Doctrine\Common\Collections\Collection
  126.      *
  127.      * @ORM\OneToMany(targetEntity="App\Entity\EditionsPlanner", mappedBy="planification", cascade={"persist","remove"})
  128.      */
  129.     private $planners;
  130.     /**
  131.      * @var \Doctrine\Common\Collections\Collection
  132.      *
  133.      * @ORM\OneToMany(targetEntity="App\Entity\GuideAccueilDestinataire", mappedBy="planification", cascade={"persist","remove"})
  134.      */
  135.     private $guideAccueilDestinataires;
  136.     public function __construct()
  137.     {
  138.         $this->planners = new ArrayCollection();
  139.         $this->guideAccueilDestinataires = new ArrayCollection();
  140.     }
  141.     public function getId(): ?int
  142.     {
  143.         return $this->id;
  144.     }
  145.     public function getName(): ?string
  146.     {
  147.         return $this->name;
  148.     }
  149.     public function setName(string $name): self
  150.     {
  151.         $this->name $name;
  152.         return $this;
  153.     }
  154.     public function getSelection(): ?Selection
  155.     {
  156.         return $this->selection;
  157.     }
  158.     public function setSelection(?Selection $selection): self
  159.     {
  160.         $this->selection $selection;
  161.         return $this;
  162.     }
  163.     public function getModele(): ?EditionModele
  164.     {
  165.         return $this->modele;
  166.     }
  167.     public function setModele(?EditionModele $modele): self
  168.     {
  169.         $this->modele $modele;
  170.         return $this;
  171.     }
  172.     public function getExportMode(): ?string
  173.     {
  174.         return $this->exportMode;
  175.     }
  176.     public function setExportMode(?string $exportMode): self
  177.     {
  178.         // Ajout d'un log pour vérifier si on rentre ici
  179.         error_log(sprintf('setExportMode called with: %s'$exportMode));
  180.         $this->exportMode $exportMode;
  181.         return $this;
  182.     }
  183.     public function getFrequence(): ?string
  184.     {
  185.         return $this->frequence;
  186.     }
  187.     public function setFrequence(?string $frequence): self
  188.     {
  189.         $this->frequence $frequence;
  190.         return $this;
  191.     }
  192.     public function getTime(): ?array
  193.     {
  194.         return $this->time;
  195.     }
  196.     public function setTime(?array $time): self
  197.     {
  198.         $this->time $time;
  199.         return $this;
  200.     }
  201.     public function getTexteVolee(): ?string
  202.     {
  203.         return $this->texteVolee;
  204.     }
  205.     public function setTexteVolee(?string $texteVolee): self
  206.     {
  207.         $this->texteVolee $texteVolee;
  208.         return $this;
  209.     }
  210.     public function getEmail(): ?string
  211.     {
  212.         return $this->email;
  213.     }
  214.     public function setEmail(?string $email): self
  215.     {
  216.         $this->email $email;
  217.         return $this;
  218.     }
  219.     public function getSendByEmail(): ?bool
  220.     {
  221.         return $this->sendByEmail;
  222.     }
  223.     public function setSendByEmail(?bool $sendByEmail): self
  224.     {
  225.         $this->sendByEmail $sendByEmail;
  226.         return $this;
  227.     }
  228.     public function getReceptionType(): ?string
  229.     {
  230.         return $this->receptionType;
  231.     }
  232.     public function setReceptionType(?string $receptionType): self
  233.     {
  234.         $this->receptionType $receptionType;
  235.         return $this;
  236.     }
  237.     public function getFtpData(): ?array
  238.     {
  239.         return $this->ftpData;
  240.     }
  241.     public function setFtpData(?array $ftpData): self
  242.     {
  243.         $this->ftpData $ftpData;
  244.         return $this;
  245.     }
  246.     public function getDueDate(): ?\DateTimeInterface
  247.     {
  248.         return $this->dueDate;
  249.     }
  250.     public function setDueDate(?\DateTimeInterface $dueDate): self
  251.     {
  252.         $this->dueDate $dueDate;
  253.         return $this;
  254.     }
  255.     public function getEnableNotifications(): ?bool
  256.     {
  257.         return $this->enableNotifications;
  258.     }
  259.     public function setEnableNotifications(?bool $enableNotifications): self
  260.     {
  261.         $this->enableNotifications $enableNotifications;
  262.         return $this;
  263.     }
  264.     public function getLang(): ?string
  265.     {
  266.         return $this->lang;
  267.     }
  268.     public function setLang(?string $lang): self
  269.     {
  270.         $this->lang $lang;
  271.         return $this;
  272.     }
  273.     public function getOwner(): ?User
  274.     {
  275.         return $this->owner;
  276.     }
  277.     public function setOwner(?User $owner): self
  278.     {
  279.         $this->owner $owner;
  280.         return $this;
  281.     }
  282.     public function getEntity(): ?DnsitEntity
  283.     {
  284.         return $this->entity;
  285.     }
  286.     public function setEntity(?DnsitEntity $entity): self
  287.     {
  288.         $this->entity $entity;
  289.         return $this;
  290.     }
  291.     public function getCreatedAt(): ?\DateTimeInterface
  292.     {
  293.         return $this->createdAt;
  294.     }
  295.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  296.     {
  297.         $this->createdAt $createdAt;
  298.         return $this;
  299.     }
  300.     public function getUpdatedAt(): ?\DateTimeInterface
  301.     {
  302.         return $this->updatedAt;
  303.     }
  304.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  305.     {
  306.         $this->updatedAt $updatedAt;
  307.         return $this;
  308.     }
  309.     public function getState(): ?int
  310.     {
  311.         return $this->state;
  312.     }
  313.     public function setState(?int $state): self
  314.     {
  315.         $this->state $state;
  316.         return $this;
  317.     }
  318.     public function getDisabled(): ?bool
  319.     {
  320.         return $this->disabled;
  321.     }
  322.     public function setDisabled(bool $disabled): self
  323.     {
  324.         $this->disabled $disabled;
  325.         return $this;
  326.     }
  327.     public function getPermanentFilename(): ?string
  328.     {
  329.         return $this->permanentFilename;
  330.     }
  331.     public function setPermanentFilename(?string $permanentFilename): self
  332.     {
  333.         $permanentFilename PlanificationService::cleanFileName($permanentFilename);
  334.         $this->permanentFilename $permanentFilename;
  335.         return $this;
  336.     }
  337.     public function getModeGuideAccueil(): ?bool
  338.     {
  339.         return $this->modeGuideAccueil;
  340.     }
  341.     public function setModeGuideAccueil(?bool $modeGuideAccueil): self
  342.     {
  343.         $this->modeGuideAccueil $modeGuideAccueil;
  344.         return $this;
  345.     }
  346.     public function getSelectionGuideAccueil(): ?Selection
  347.     {
  348.         return $this->selectionGuideAccueil;
  349.     }
  350.     public function setSelectionGuideAccueil(?Selection $selectionGuideAccueil): self
  351.     {
  352.         $this->selectionGuideAccueil $selectionGuideAccueil;
  353.         return $this;
  354.     }
  355.     public function getRayonGuideAccueil(): ?int
  356.     {
  357.         return $this->rayonGuideAccueil;
  358.     }
  359.     public function setRayonGuideAccueil(?int $rayonGuideAccueil): self
  360.     {
  361.         $this->rayonGuideAccueil $rayonGuideAccueil;
  362.         return $this;
  363.     }
  364.     public function getFilterGuideAccueil(): ?string
  365.     {
  366.         return $this->filterGuideAccueil;
  367.     }
  368.     public function setFilterGuideAccueil(?string $filterGuideAccueil): self
  369.     {
  370.         $this->filterGuideAccueil $filterGuideAccueil;
  371.         return $this;
  372.     }
  373.     /**
  374.      * @return Collection|EditionsPlanner[]
  375.      */
  376.     public function getPlanners(): Collection
  377.     {
  378.         return $this->planners;
  379.     }
  380.     public function addPlanner(EditionsPlanner $planner): self
  381.     {
  382.         if (!$this->planners->contains($planner)) {
  383.             $this->planners[] = $planner;
  384.             $planner->setOwner($this);
  385.         }
  386.         return $this;
  387.     }
  388.     public function removePlanner(EditionsPlanner $planner): self
  389.     {
  390.         if ($this->planners->contains($planner)) {
  391.             $this->planners->removeElement($planner);
  392.             // set the owning side to null (unless already changed)
  393.             if ($planner->getOwner() === $this) {
  394.                 $planner->setOwner(null);
  395.             }
  396.         }
  397.         return $this;
  398.     }
  399.     /**
  400.      * @return Collection|GuideAccueilDestinataire[]
  401.      */
  402.     public function getGuideAccueilDestinataires(): Collection
  403.     {
  404.         return $this->guideAccueilDestinataires;
  405.     }
  406.     public function addGuideAccueilDestinataire(GuideAccueilDestinataire $guideAccueilDestinataire): self
  407.     {
  408.         if (!$this->guideAccueilDestinataires->contains($guideAccueilDestinataire)) {
  409.             $this->guideAccueilDestinataires[] = $guideAccueilDestinataire;
  410.             $guideAccueilDestinataire->setPlanification($this);
  411.         }
  412.         return $this;
  413.     }
  414.     public function removeGuideAccueilDestinataire(GuideAccueilDestinataire $guideAccueilDestinataire): self
  415.     {
  416.         if ($this->guideAccueilDestinataires->contains($guideAccueilDestinataire)) {
  417.             $this->guideAccueilDestinataires->removeElement($guideAccueilDestinataire);
  418.             // set the owning side to null (unless already changed)
  419.             if ($guideAccueilDestinataire->getPlanification() === $this) {
  420.                 $guideAccueilDestinataire->setPlanification(null);
  421.             }
  422.         }
  423.         return $this;
  424.     }
  425. }