src/Entity/Document.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocumentRepository;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * @Vich\Uploadable
  12.  */
  13. #[ORM\Entity(repositoryClassDocumentRepository::class)]
  14. class Document implements \Stringable
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column(type'integer')]
  19.     private int $id;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private ?string $titrenull;
  22.     #[ORM\ManyToMany(targetEntityTypeDocument::class, inversedBy'documents')]
  23.     private $types;
  24.     #[ORM\Column(type'text'nullabletrue)]
  25.     private ?string $descriptionnull;
  26.     #[ORM\Column(type'string'length255nullabletrue)]
  27.     private ?string $fichier_namenull;
  28.     /**
  29.      * @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name")
  30.      */
  31.     private ?\Symfony\Component\HttpFoundation\File\File $fichier null;
  32.     #[ORM\Column(type'text'nullabletrue)]
  33.     private ?string $contentnull;
  34.     #[ORM\Column(type'datetime'nullabletrue)]
  35.     private DateTime $date_publication;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     private ?string $format_filenull;
  38.     #[ORM\Column(type'string'length255nullabletrue)]
  39.     private ?string $poidsnull;
  40.     #[ORM\ManyToMany(targetEntityDocument::class, inversedBy'documents')]
  41.     private $documents_lies;
  42.     #[ORM\ManyToMany(targetEntityDocument::class, mappedBy'documents_lies')]
  43.     private $documents;
  44.     #[ORM\ManyToMany(targetEntityPolitiqueDepartementale::class, mappedBy'documents')]
  45.     private $politiqueDepartementales;
  46.     #[ORM\Column(type'datetime'nullabletrue)]
  47.     private $date_update;
  48.     #[ORM\Column(type'string'length255nullabletrue)]
  49.     private ?string $fichier_name2null;
  50.     /**
  51.      * @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name2")
  52.      */
  53.     private ?\Symfony\Component\HttpFoundation\File\File $fichier2 null;
  54.     #[ORM\Column(type'string'length255nullabletrue)]
  55.     private ?string $fichier_name3null;
  56.     /**
  57.      * @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name3")
  58.      */
  59.     private ?\Symfony\Component\HttpFoundation\File\File $fichier3 null;
  60.     #[ORM\Column(type'string'length255nullabletrue)]
  61.     private ?string $fichier_name4null;
  62.     /**
  63.      * @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name4")
  64.      */
  65.     private ?\Symfony\Component\HttpFoundation\File\File $fichier4 null;
  66.     #[ORM\Column(type'string'length255nullabletrue)]
  67.     private ?string $url_fichier_extnull;
  68.     #[ORM\ManyToOne(targetEntityStatut::class, inversedBy'documents')]
  69.     private $statut;
  70.     #[ORM\Column(type'string'length255nullabletrue)]
  71.     private ?string $alias_urlnull;
  72.     #[ORM\Column(type'text'nullabletrue)]
  73.     private ?string $description_accessibilitenull;
  74.     #[ORM\Column(type'string'length255nullabletrue)]
  75.     private ?string $libelle_fichier1null;
  76.     #[ORM\Column(type'string'length255nullabletrue)]
  77.     private ?string $libelle_fichier2null;
  78.     #[ORM\Column(type'string'length255nullabletrue)]
  79.     private ?string $libelle_fichier3null;
  80.     #[ORM\Column(type'string'length255nullabletrue)]
  81.     private ?string $libelle_fichier4null;
  82.     #[ORM\Column(type'string'length255nullabletrue)]
  83.     private ?string $fichier_name5null;
  84.     /**
  85.      * @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name5")
  86.      */
  87.     private ?\Symfony\Component\HttpFoundation\File\File $fichier5 null;
  88.     #[ORM\Column(type'string'length255nullabletrue)]
  89.     private ?string $fichier_name6null;
  90.     /**
  91.      * @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name6")
  92.      */
  93.     private ?\Symfony\Component\HttpFoundation\File\File $fichier6 null;
  94.     #[ORM\Column(type'string'length255nullabletrue)]
  95.     private ?string $libelle_fichier5null;
  96.     #[ORM\Column(type'string'length255nullabletrue)]
  97.     private ?string $libelle_fichier6null;
  98.     #[ORM\Column(type'string'length255nullabletrue)]
  99.     private ?string $poids2null;
  100.     #[ORM\Column(type'string'length255nullabletrue)]
  101.     private ?string $poids3null;
  102.     #[ORM\Column(type'string'length255nullabletrue)]
  103.     private ?string $poids4null;
  104.     #[ORM\Column(type'string'length255nullabletrue)]
  105.     private ?string $poids5null;
  106.     #[ORM\Column(type'string'length255nullabletrue)]
  107.     private ?string $poids6null;
  108.     #[ORM\Column(type'string'length255nullabletrue)]
  109.     private ?string $format_file2null;
  110.     #[ORM\Column(type'string'length255nullabletrue)]
  111.     private ?string $format_file3null;
  112.     #[ORM\Column(type'string'length255nullabletrue)]
  113.     private ?string $format_file4null;
  114.     #[ORM\Column(type'string'length255nullabletrue)]
  115.     private ?string $format_file5null;
  116.     #[ORM\Column(type'string'length255nullabletrue)]
  117.     private ?string $format_file6null;
  118.     #[ORM\ManyToMany(targetEntityEpingle::class, mappedBy'visible_documents')]
  119.     private $epingles;
  120.     #[ORM\Column(type'string'length255nullabletrue)]
  121.     private ?string $annexe_urlnull;
  122.     #[ORM\Column(type'boolean'nullabletrue)]
  123.     private ?bool $import;
  124.     #[ORM\ManyToMany(targetEntityPageSatellite::class, mappedBy'documents')]
  125.     private Collection $pageSatellites;
  126.     public function __construct()
  127.     {
  128.         $this->types = new ArrayCollection();
  129.         $this->documents_lies = new ArrayCollection();
  130.         $this->documents = new ArrayCollection();
  131.         $this->politiqueDepartementales = new ArrayCollection();
  132.         $this->epingles = new ArrayCollection();
  133.         $this->pageSatellites = new ArrayCollection();
  134.     }
  135.     public function setFichier(File $file null): void
  136.     {
  137.         $this->fichier $file;
  138.         if ($file) {
  139.             $this->date_update = new \DateTime;
  140.         }
  141.     }
  142.     public function getFichier(): mixed
  143.     {
  144.         return $this->fichier;
  145.     }
  146.     public function setFichier2(File $file null): void
  147.     {
  148.         $this->fichier2 $file;
  149.         if ($file) {
  150.             $this->date_update = new \DateTime;
  151.         }
  152.     }
  153.     public function getFichier2(): mixed
  154.     {
  155.         return $this->fichier2;
  156.     }
  157.     public function setFichier3(File $file null): void
  158.     {
  159.         $this->fichier3 $file;
  160.         if ($file) {
  161.             $this->date_update = new \DateTime;
  162.         }
  163.     }
  164.     public function getFichier3(): mixed
  165.     {
  166.         return $this->fichier3;
  167.     }
  168.     public function setFichier4(File $file null): void
  169.     {
  170.         $this->fichier4 $file;
  171.         if ($file) {
  172.             $this->date_update = new \DateTime;
  173.         }
  174.     }
  175.     public function getFichier4(): mixed
  176.     {
  177.         return $this->fichier4;
  178.     }
  179.     public function getId(): ?int
  180.     {
  181.         return $this->id;
  182.     }
  183.     public function getTitre(): ?string
  184.     {
  185.         return $this->titre;
  186.     }
  187.     public function setTitre(?string $titre): self
  188.     {
  189.         $this->titre $titre;
  190.         return $this;
  191.     }
  192.     /**
  193.      * @return Collection|TypeDocument[]
  194.      */
  195.     public function getTypes(): Collection
  196.     {
  197.         return $this->types;
  198.     }
  199.     public function addType(TypeDocument $type): self
  200.     {
  201.         if (!$this->types->contains($type)) {
  202.             $this->types[] = $type;
  203.         }
  204.         return $this;
  205.     }
  206.     public function removeType(TypeDocument $type): self
  207.     {
  208.         $this->types->removeElement($type);
  209.         return $this;
  210.     }
  211.     public function getDescription(): ?string
  212.     {
  213.         return $this->description;
  214.     }
  215.     public function setDescription(?string $description): self
  216.     {
  217.         $this->description $description;
  218.         return $this;
  219.     }
  220.     public function getFichierName(): ?string
  221.     {
  222.         return $this->fichier_name;
  223.     }
  224.     public function setFichierName(?string $fichier_name): self
  225.     {
  226.         $this->fichier_name $fichier_name;
  227.         return $this;
  228.     }
  229.     public function getContent(): ?string
  230.     {
  231.         return $this->content;
  232.     }
  233.     public function setContent(?string $content): self
  234.     {
  235.         $this->content $content;
  236.         return $this;
  237.     }
  238.     public function getDatePublication(): ?\DateTimeInterface
  239.     {
  240.         return $this->date_publication;
  241.     }
  242.     public function setDatePublication(?\DateTimeInterface $date_publication): self
  243.     {
  244.         $this->date_publication $date_publication;
  245.         return $this;
  246.     }
  247.     public function getFormatFile(): ?string
  248.     {
  249.         return $this->format_file;
  250.     }
  251.     public function setFormatFile(?string $format_file): self
  252.     {
  253.         $this->format_file $format_file;
  254.         return $this;
  255.     }
  256.     public function getPoids(): ?string
  257.     {
  258.         return $this->poids;
  259.     }
  260.     public function setPoids(?string $poids): self
  261.     {
  262.         $this->poids $poids;
  263.         return $this;
  264.     }
  265.     /**
  266.      * @return Collection|self[]
  267.      */
  268.     public function getDocumentsLies(): Collection
  269.     {
  270.         return $this->documents_lies;
  271.     }
  272.     public function addDocumentsLie(self $documentsLy): self
  273.     {
  274.         if (!$this->documents_lies->contains($documentsLy)) {
  275.             $this->documents_lies[] = $documentsLy;
  276.         }
  277.         return $this;
  278.     }
  279.     public function removeDocumentsLie(self $documentsLy): self
  280.     {
  281.         $this->documents_lies->removeElement($documentsLy);
  282.         return $this;
  283.     }
  284.     /**
  285.      * @return Collection|self[]
  286.      */
  287.     public function getDocuments(): Collection
  288.     {
  289.         return $this->documents;
  290.     }
  291.     public function addDocument(self $document): self
  292.     {
  293.         if (!$this->documents->contains($document)) {
  294.             $this->documents[] = $document;
  295.             $document->addDocumentsLie($this);
  296.         }
  297.         return $this;
  298.     }
  299.     public function removeDocument(self $document): self
  300.     {
  301.         if ($this->documents->removeElement($document)) {
  302.             $document->removeDocumentsLie($this);
  303.         }
  304.         return $this;
  305.     }
  306.     /**
  307.      * @return Collection|PolitiqueDepartementale[]
  308.      */
  309.     public function getPolitiqueDepartementales(): Collection
  310.     {
  311.         return $this->politiqueDepartementales;
  312.     }
  313.     public function addPolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
  314.     {
  315.         if (!$this->politiqueDepartementales->contains($politiqueDepartementale)) {
  316.             $this->politiqueDepartementales[] = $politiqueDepartementale;
  317.             $politiqueDepartementale->addDocument($this);
  318.         }
  319.         return $this;
  320.     }
  321.     public function removePolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
  322.     {
  323.         if ($this->politiqueDepartementales->removeElement($politiqueDepartementale)) {
  324.             $politiqueDepartementale->removeDocument($this);
  325.         }
  326.         return $this;
  327.     }
  328.     public function getDateUpdate(): ?\DateTimeInterface
  329.     {
  330.         return $this->date_update;
  331.     }
  332.     public function setDateUpdate(?\DateTimeInterface $date_update): self
  333.     {
  334.         $this->date_update $date_update;
  335.         return $this;
  336.     }
  337.     public function getFichierName2(): ?string
  338.     {
  339.         return $this->fichier_name2;
  340.     }
  341.     public function setFichierName2(?string $fichier_name2): self
  342.     {
  343.         $this->fichier_name2 $fichier_name2;
  344.         return $this;
  345.     }
  346.     public function getFichierName3(): ?string
  347.     {
  348.         return $this->fichier_name3;
  349.     }
  350.     public function setFichierName3(?string $fichier_name3): self
  351.     {
  352.         $this->fichier_name3 $fichier_name3;
  353.         return $this;
  354.     }
  355.     public function getFichierName4(): ?string
  356.     {
  357.         return $this->fichier_name4;
  358.     }
  359.     public function setFichierName4(?string $fichier_name4): self
  360.     {
  361.         $this->fichier_name4 $fichier_name4;
  362.         return $this;
  363.     }
  364.     public function __toString(): string
  365.     {
  366.         return (string) $this->titre;
  367.     }
  368.     public function getUrlFichierExt(): ?string
  369.     {
  370.         return $this->url_fichier_ext;
  371.     }
  372.     public function setUrlFichierExt(?string $url_fichier_ext): self
  373.     {
  374.         $this->url_fichier_ext $url_fichier_ext;
  375.         return $this;
  376.     }
  377.     public function getStatut(): ?Statut
  378.     {
  379.         return $this->statut;
  380.     }
  381.     public function setStatut(?Statut $statut): self
  382.     {
  383.         $this->statut $statut;
  384.         return $this;
  385.     }
  386.     public function getAliasUrl(): ?string
  387.     {
  388.         return $this->alias_url;
  389.     }
  390.     public function setAliasUrl(?string $alias_url): self
  391.     {
  392.         $this->alias_url $alias_url;
  393.         return $this;
  394.     }
  395.     public function getDescriptionAccessibilite(): ?string
  396.     {
  397.         return $this->description_accessibilite;
  398.     }
  399.     public function setDescriptionAccessibilite(?string $description_accessibilite): self
  400.     {
  401.         $this->description_accessibilite $description_accessibilite;
  402.         return $this;
  403.     }
  404.     public function getLibelleFichier1(): ?string
  405.     {
  406.         return $this->libelle_fichier1;
  407.     }
  408.     public function setLibelleFichier1(?string $libelle_fichier1): self
  409.     {
  410.         $this->libelle_fichier1 $libelle_fichier1;
  411.         return $this;
  412.     }
  413.     public function getLibelleFichier2(): ?string
  414.     {
  415.         return $this->libelle_fichier2;
  416.     }
  417.     public function setLibelleFichier2(?string $libelle_fichier2): self
  418.     {
  419.         $this->libelle_fichier2 $libelle_fichier2;
  420.         return $this;
  421.     }
  422.     public function getLibelleFichier3(): ?string
  423.     {
  424.         return $this->libelle_fichier3;
  425.     }
  426.     public function setLibelleFichier3(?string $libelle_fichier3): self
  427.     {
  428.         $this->libelle_fichier3 $libelle_fichier3;
  429.         return $this;
  430.     }
  431.     public function getLibelleFichier4(): ?string
  432.     {
  433.         return $this->libelle_fichier4;
  434.     }
  435.     public function setLibelleFichier4(?string $libelle_fichier4): self
  436.     {
  437.         $this->libelle_fichier4 $libelle_fichier4;
  438.         return $this;
  439.     }
  440.     public function getFichierName5(): ?string
  441.     {
  442.         return $this->fichier_name5;
  443.     }
  444.     public function setFichierName5(?string $fichier_name5): self
  445.     {
  446.         $this->fichier_name5 $fichier_name5;
  447.         return $this;
  448.     }
  449.     public function getFichierName6(): ?string
  450.     {
  451.         return $this->fichier_name6;
  452.     }
  453.     public function setFichierName6(?string $fichier_name6): self
  454.     {
  455.         $this->fichier_name6 $fichier_name6;
  456.         return $this;
  457.     }
  458.     public function getLibelleFichier5(): ?string
  459.     {
  460.         return $this->libelle_fichier5;
  461.     }
  462.     public function setLibelleFichier5(?string $libelle_fichier5): self
  463.     {
  464.         $this->libelle_fichier5 $libelle_fichier5;
  465.         return $this;
  466.     }
  467.     public function getLibelleFichier6(): ?string
  468.     {
  469.         return $this->libelle_fichier6;
  470.     }
  471.     public function setLibelleFichier6(?string $libelle_fichier6): self
  472.     {
  473.         $this->libelle_fichier6 $libelle_fichier6;
  474.         return $this;
  475.     }
  476.     public function setFichier5(File $file null): void
  477.     {
  478.         $this->fichier5 $file;
  479.         if ($file) {
  480.             $this->date_update = new \DateTime;
  481.         }
  482.     }
  483.     public function getFichier5(): mixed
  484.     {
  485.         return $this->fichier5;
  486.     }
  487.     public function setFichier6(File $file null): void
  488.     {
  489.         $this->fichier6 $file;
  490.         if ($file) {
  491.             $this->date_update = new \DateTime;
  492.         }
  493.     }
  494.     public function getFichier6(): mixed
  495.     {
  496.         return $this->fichier6;
  497.     }
  498.     public function getPoids2(): ?string
  499.     {
  500.         return $this->poids2;
  501.     }
  502.     public function setPoids2(?string $poids2): self
  503.     {
  504.         $this->poids2 $poids2;
  505.         return $this;
  506.     }
  507.     public function getPoids3(): ?string
  508.     {
  509.         return $this->poids3;
  510.     }
  511.     public function setPoids3(?string $poids3): self
  512.     {
  513.         $this->poids3 $poids3;
  514.         return $this;
  515.     }
  516.     public function getPoids4(): ?string
  517.     {
  518.         return $this->poids4;
  519.     }
  520.     public function setPoids4(?string $poids4): self
  521.     {
  522.         $this->poids4 $poids4;
  523.         return $this;
  524.     }
  525.     public function getPoids5(): ?string
  526.     {
  527.         return $this->poids5;
  528.     }
  529.     public function setPoids5(?string $poids5): self
  530.     {
  531.         $this->poids5 $poids5;
  532.         return $this;
  533.     }
  534.     public function getPoids6(): ?string
  535.     {
  536.         return $this->poids6;
  537.     }
  538.     public function setPoids6(?string $poids6): self
  539.     {
  540.         $this->poids6 $poids6;
  541.         return $this;
  542.     }
  543.     public function getFormatFile2(): ?string
  544.     {
  545.         return $this->format_file2;
  546.     }
  547.     public function setFormatFile2(?string $format_file2): self
  548.     {
  549.         $this->format_file2 $format_file2;
  550.         return $this;
  551.     }
  552.     public function getFormatFile3(): ?string
  553.     {
  554.         return $this->format_file3;
  555.     }
  556.     public function setFormatFile3(?string $format_file3): self
  557.     {
  558.         $this->format_file3 $format_file3;
  559.         return $this;
  560.     }
  561.     public function getFormatFile4(): ?string
  562.     {
  563.         return $this->format_file4;
  564.     }
  565.     public function setFormatFile4(?string $format_file4): self
  566.     {
  567.         $this->format_file4 $format_file4;
  568.         return $this;
  569.     }
  570.     public function getFormatFile5(): ?string
  571.     {
  572.         return $this->format_file5;
  573.     }
  574.     public function setFormatFile5(?string $format_file5): self
  575.     {
  576.         $this->format_file5 $format_file5;
  577.         return $this;
  578.     }
  579.     public function getFormatFile6(): ?string
  580.     {
  581.         return $this->format_file6;
  582.     }
  583.     public function setFormatFile6(?string $format_file6): self
  584.     {
  585.         $this->format_file6 $format_file6;
  586.         return $this;
  587.     }
  588.     /**
  589.      * @return Collection|Epingle[]
  590.      */
  591.     public function getEpingles(): Collection
  592.     {
  593.         return $this->epingles;
  594.     }
  595.     public function addEpingle(Epingle $epingle): self
  596.     {
  597.         if (!$this->epingles->contains($epingle)) {
  598.             $this->epingles[] = $epingle;
  599.             $epingle->addVisibleDocument($this);
  600.         }
  601.         return $this;
  602.     }
  603.     public function removeEpingle(Epingle $epingle): self
  604.     {
  605.         if ($this->epingles->removeElement($epingle)) {
  606.             $epingle->removeVisibleDocument($this);
  607.         }
  608.         return $this;
  609.     }
  610.     public function getAnnexeUrl(): ?string
  611.     {
  612.         return $this->annexe_url;
  613.     }
  614.     public function setAnnexeUrl(?string $annexe_url): self
  615.     {
  616.         $this->annexe_url $annexe_url;
  617.         return $this;
  618.     }
  619.     public function isImport(): ?bool
  620.     {
  621.         return $this->import;
  622.     }
  623.     public function setImport(?bool $import): self
  624.     {
  625.         $this->import $import;
  626.         return $this;
  627.     }
  628.     /**
  629.      * @return Collection<int, PageSatellite>
  630.      */
  631.     public function getPageSatellites(): Collection
  632.     {
  633.         return $this->pageSatellites;
  634.     }
  635.     public function addPageSatellite(PageSatellite $pageSatellite): self
  636.     {
  637.         if (!$this->pageSatellites->contains($pageSatellite)) {
  638.             $this->pageSatellites->add($pageSatellite);
  639.             $pageSatellite->addDocument($this);
  640.         }
  641.         return $this;
  642.     }
  643.     public function removePageSatellite(PageSatellite $pageSatellite): self
  644.     {
  645.         if ($this->pageSatellites->removeElement($pageSatellite)) {
  646.             $pageSatellite->removeDocument($this);
  647.         }
  648.         return $this;
  649.     }
  650. }