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_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", cascade={"persist"})
  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.     public function __construct()
  131.     {
  132.         $this->planners = new ArrayCollection();
  133.     }
  134.     public function getId(): ?int
  135.     {
  136.         return $this->id;
  137.     }
  138.     public function getName(): ?string
  139.     {
  140.         return $this->name;
  141.     }
  142.     public function setName(string $name): self
  143.     {
  144.         $this->name $name;
  145.         return $this;
  146.     }
  147.     public function getSelection(): ?Selection
  148.     {
  149.         return $this->selection;
  150.     }
  151.     public function setSelection(?Selection $selection): self
  152.     {
  153.         $this->selection $selection;
  154.         return $this;
  155.     }
  156.     public function getModele(): ?EditionModele
  157.     {
  158.         return $this->modele;
  159.     }
  160.     public function setModele(?EditionModele $modele): self
  161.     {
  162.         $this->modele $modele;
  163.         return $this;
  164.     }
  165.     public function getExportMode(): ?string
  166.     {
  167.         return $this->exportMode;
  168.     }
  169.     public function setExportMode(?string $exportMode): self
  170.     {
  171.         // Ajout d'un log pour vérifier si on rentre ici
  172.         error_log(sprintf('setExportMode called with: %s'$exportMode));
  173.         $this->exportMode $exportMode;
  174.         return $this;
  175.     }
  176.     public function getFrequence(): ?string
  177.     {
  178.         return $this->frequence;
  179.     }
  180.     public function setFrequence(?string $frequence): self
  181.     {
  182.         $this->frequence $frequence;
  183.         return $this;
  184.     }
  185.     public function getTime(): ?array
  186.     {
  187.         return $this->time;
  188.     }
  189.     public function setTime(?array $time): self
  190.     {
  191.         $this->time $time;
  192.         return $this;
  193.     }
  194.     public function getTexteVolee(): ?string
  195.     {
  196.         return $this->texteVolee;
  197.     }
  198.     public function setTexteVolee(?string $texteVolee): self
  199.     {
  200.         $this->texteVolee $texteVolee;
  201.         return $this;
  202.     }
  203.     public function getEmail(): ?string
  204.     {
  205.         return $this->email;
  206.     }
  207.     public function setEmail(?string $email): self
  208.     {
  209.         $this->email $email;
  210.         return $this;
  211.     }
  212.     public function getSendByEmail(): ?bool
  213.     {
  214.         return $this->sendByEmail;
  215.     }
  216.     public function setSendByEmail(?bool $sendByEmail): self
  217.     {
  218.         $this->sendByEmail $sendByEmail;
  219.         return $this;
  220.     }
  221.     public function getReceptionType(): ?string
  222.     {
  223.         return $this->receptionType;
  224.     }
  225.     public function setReceptionType(?string $receptionType): self
  226.     {
  227.         $this->receptionType $receptionType;
  228.         return $this;
  229.     }
  230.     public function getFtpData(): ?array
  231.     {
  232.         return $this->ftpData;
  233.     }
  234.     public function setFtpData(?array $ftpData): self
  235.     {
  236.         $this->ftpData $ftpData;
  237.         return $this;
  238.     }
  239.     public function getDueDate(): ?\DateTimeInterface
  240.     {
  241.         return $this->dueDate;
  242.     }
  243.     public function setDueDate(?\DateTimeInterface $dueDate): self
  244.     {
  245.         $this->dueDate $dueDate;
  246.         return $this;
  247.     }
  248.     public function getEnableNotifications(): ?bool
  249.     {
  250.         return $this->enableNotifications;
  251.     }
  252.     public function setEnableNotifications(?bool $enableNotifications): self
  253.     {
  254.         $this->enableNotifications $enableNotifications;
  255.         return $this;
  256.     }
  257.     public function getLang(): ?string
  258.     {
  259.         return $this->lang;
  260.     }
  261.     public function setLang(?string $lang): self
  262.     {
  263.         $this->lang $lang;
  264.         return $this;
  265.     }
  266.     public function getOwner(): ?User
  267.     {
  268.         return $this->owner;
  269.     }
  270.     public function setOwner(?User $owner): self
  271.     {
  272.         $this->owner $owner;
  273.         return $this;
  274.     }
  275.     public function getEntity(): ?DnsitEntity
  276.     {
  277.         return $this->entity;
  278.     }
  279.     public function setEntity(?DnsitEntity $entity): self
  280.     {
  281.         $this->entity $entity;
  282.         return $this;
  283.     }
  284.     public function getCreatedAt(): ?\DateTimeInterface
  285.     {
  286.         return $this->createdAt;
  287.     }
  288.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  289.     {
  290.         $this->createdAt $createdAt;
  291.         return $this;
  292.     }
  293.     public function getUpdatedAt(): ?\DateTimeInterface
  294.     {
  295.         return $this->updatedAt;
  296.     }
  297.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  298.     {
  299.         $this->updatedAt $updatedAt;
  300.         return $this;
  301.     }
  302.     public function getState(): ?int
  303.     {
  304.         return $this->state;
  305.     }
  306.     public function setState(?int $state): self
  307.     {
  308.         $this->state $state;
  309.         return $this;
  310.     }
  311.     public function getDisabled(): ?bool
  312.     {
  313.         return $this->disabled;
  314.     }
  315.     public function setDisabled(bool $disabled): self
  316.     {
  317.         $this->disabled $disabled;
  318.         return $this;
  319.     }
  320.     public function getPermanentFilename(): ?string
  321.     {
  322.         return $this->permanentFilename;
  323.     }
  324.     public function setPermanentFilename(?string $permanentFilename): self
  325.     {
  326.         $permanentFilename PlanificationService::cleanFileName($permanentFilename);
  327.         $this->permanentFilename $permanentFilename;
  328.         return $this;
  329.     }
  330.     public function getModeGuideAccueil(): ?bool
  331.     {
  332.         return $this->modeGuideAccueil;
  333.     }
  334.     public function setModeGuideAccueil(?bool $modeGuideAccueil): self
  335.     {
  336.         $this->modeGuideAccueil $modeGuideAccueil;
  337.         return $this;
  338.     }
  339.     public function getSelectionGuideAccueil(): ?Selection
  340.     {
  341.         return $this->selectionGuideAccueil;
  342.     }
  343.     public function setSelectionGuideAccueil(?Selection $selectionGuideAccueil): self
  344.     {
  345.         $this->selectionGuideAccueil $selectionGuideAccueil;
  346.         return $this;
  347.     }
  348.     public function getRayonGuideAccueil(): ?int
  349.     {
  350.         return $this->rayonGuideAccueil;
  351.     }
  352.     public function setRayonGuideAccueil(?int $rayonGuideAccueil): self
  353.     {
  354.         $this->rayonGuideAccueil $rayonGuideAccueil;
  355.         return $this;
  356.     }
  357.     public function getFilterGuideAccueil(): ?string
  358.     {
  359.         return $this->filterGuideAccueil;
  360.     }
  361.     public function setFilterGuideAccueil(?string $filterGuideAccueil): self
  362.     {
  363.         $this->filterGuideAccueil $filterGuideAccueil;
  364.         return $this;
  365.     }
  366.     /**
  367.      * @return Collection|EditionsPlanner[]
  368.      */
  369.     public function getPlanners(): Collection
  370.     {
  371.         return $this->planners;
  372.     }
  373.     public function addPlanner(EditionsPlanner $planner): self
  374.     {
  375.         if (!$this->planners->contains($planner)) {
  376.             $this->planners[] = $planner;
  377.             $planner->setOwner($this);
  378.         }
  379.         return $this;
  380.     }
  381.     public function removePlanner(EditionsPlanner $planner): self
  382.     {
  383.         if ($this->planners->contains($planner)) {
  384.             $this->planners->removeElement($planner);
  385.             // set the owning side to null (unless already changed)
  386.             if ($planner->getOwner() === $this) {
  387.                 $planner->setOwner(null);
  388.             }
  389.         }
  390.         return $this;
  391.     }
  392. }