<?php
namespace App\Entity;
use App\Repository\DocumentRepository;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @Vich\Uploadable
*/
#[ORM\Entity(repositoryClass: DocumentRepository::class)]
class Document implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $titre= null;
#[ORM\ManyToMany(targetEntity: TypeDocument::class, inversedBy: 'documents')]
private $types;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fichier_name= null;
/**
* @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name")
*/
private ?\Symfony\Component\HttpFoundation\File\File $fichier = null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $content= null;
#[ORM\Column(type: 'datetime', nullable: true)]
private DateTime $date_publication;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $format_file= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $poids= null;
#[ORM\ManyToMany(targetEntity: Document::class, inversedBy: 'documents')]
private $documents_lies;
#[ORM\ManyToMany(targetEntity: Document::class, mappedBy: 'documents_lies')]
private $documents;
#[ORM\ManyToMany(targetEntity: PolitiqueDepartementale::class, mappedBy: 'documents')]
private $politiqueDepartementales;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_update;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fichier_name2= null;
/**
* @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name2")
*/
private ?\Symfony\Component\HttpFoundation\File\File $fichier2 = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fichier_name3= null;
/**
* @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name3")
*/
private ?\Symfony\Component\HttpFoundation\File\File $fichier3 = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fichier_name4= null;
/**
* @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name4")
*/
private ?\Symfony\Component\HttpFoundation\File\File $fichier4 = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $url_fichier_ext= null;
#[ORM\ManyToOne(targetEntity: Statut::class, inversedBy: 'documents')]
private $statut;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $alias_url= null;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description_accessibilite= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $libelle_fichier1= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $libelle_fichier2= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $libelle_fichier3= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $libelle_fichier4= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fichier_name5= null;
/**
* @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name5")
*/
private ?\Symfony\Component\HttpFoundation\File\File $fichier5 = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fichier_name6= null;
/**
* @Vich\UploadableField(mapping="lenorddocuments", fileNameProperty="fichier_name6")
*/
private ?\Symfony\Component\HttpFoundation\File\File $fichier6 = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $libelle_fichier5= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $libelle_fichier6= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $poids2= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $poids3= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $poids4= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $poids5= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $poids6= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $format_file2= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $format_file3= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $format_file4= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $format_file5= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $format_file6= null;
#[ORM\ManyToMany(targetEntity: Epingle::class, mappedBy: 'visible_documents')]
private $epingles;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $annexe_url= null;
#[ORM\Column(type: 'boolean', nullable: true)]
private ?bool $import;
#[ORM\ManyToMany(targetEntity: PageSatellite::class, mappedBy: 'documents')]
private Collection $pageSatellites;
public function __construct()
{
$this->types = new ArrayCollection();
$this->documents_lies = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->politiqueDepartementales = new ArrayCollection();
$this->epingles = new ArrayCollection();
$this->pageSatellites = new ArrayCollection();
}
public function setFichier(File $file = null): void
{
$this->fichier = $file;
if ($file) {
$this->date_update = new \DateTime;
}
}
public function getFichier(): mixed
{
return $this->fichier;
}
public function setFichier2(File $file = null): void
{
$this->fichier2 = $file;
if ($file) {
$this->date_update = new \DateTime;
}
}
public function getFichier2(): mixed
{
return $this->fichier2;
}
public function setFichier3(File $file = null): void
{
$this->fichier3 = $file;
if ($file) {
$this->date_update = new \DateTime;
}
}
public function getFichier3(): mixed
{
return $this->fichier3;
}
public function setFichier4(File $file = null): void
{
$this->fichier4 = $file;
if ($file) {
$this->date_update = new \DateTime;
}
}
public function getFichier4(): mixed
{
return $this->fichier4;
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
/**
* @return Collection|TypeDocument[]
*/
public function getTypes(): Collection
{
return $this->types;
}
public function addType(TypeDocument $type): self
{
if (!$this->types->contains($type)) {
$this->types[] = $type;
}
return $this;
}
public function removeType(TypeDocument $type): self
{
$this->types->removeElement($type);
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getFichierName(): ?string
{
return $this->fichier_name;
}
public function setFichierName(?string $fichier_name): self
{
$this->fichier_name = $fichier_name;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getDatePublication(): ?\DateTimeInterface
{
return $this->date_publication;
}
public function setDatePublication(?\DateTimeInterface $date_publication): self
{
$this->date_publication = $date_publication;
return $this;
}
public function getFormatFile(): ?string
{
return $this->format_file;
}
public function setFormatFile(?string $format_file): self
{
$this->format_file = $format_file;
return $this;
}
public function getPoids(): ?string
{
return $this->poids;
}
public function setPoids(?string $poids): self
{
$this->poids = $poids;
return $this;
}
/**
* @return Collection|self[]
*/
public function getDocumentsLies(): Collection
{
return $this->documents_lies;
}
public function addDocumentsLie(self $documentsLy): self
{
if (!$this->documents_lies->contains($documentsLy)) {
$this->documents_lies[] = $documentsLy;
}
return $this;
}
public function removeDocumentsLie(self $documentsLy): self
{
$this->documents_lies->removeElement($documentsLy);
return $this;
}
/**
* @return Collection|self[]
*/
public function getDocuments(): Collection
{
return $this->documents;
}
public function addDocument(self $document): self
{
if (!$this->documents->contains($document)) {
$this->documents[] = $document;
$document->addDocumentsLie($this);
}
return $this;
}
public function removeDocument(self $document): self
{
if ($this->documents->removeElement($document)) {
$document->removeDocumentsLie($this);
}
return $this;
}
/**
* @return Collection|PolitiqueDepartementale[]
*/
public function getPolitiqueDepartementales(): Collection
{
return $this->politiqueDepartementales;
}
public function addPolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
{
if (!$this->politiqueDepartementales->contains($politiqueDepartementale)) {
$this->politiqueDepartementales[] = $politiqueDepartementale;
$politiqueDepartementale->addDocument($this);
}
return $this;
}
public function removePolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
{
if ($this->politiqueDepartementales->removeElement($politiqueDepartementale)) {
$politiqueDepartementale->removeDocument($this);
}
return $this;
}
public function getDateUpdate(): ?\DateTimeInterface
{
return $this->date_update;
}
public function setDateUpdate(?\DateTimeInterface $date_update): self
{
$this->date_update = $date_update;
return $this;
}
public function getFichierName2(): ?string
{
return $this->fichier_name2;
}
public function setFichierName2(?string $fichier_name2): self
{
$this->fichier_name2 = $fichier_name2;
return $this;
}
public function getFichierName3(): ?string
{
return $this->fichier_name3;
}
public function setFichierName3(?string $fichier_name3): self
{
$this->fichier_name3 = $fichier_name3;
return $this;
}
public function getFichierName4(): ?string
{
return $this->fichier_name4;
}
public function setFichierName4(?string $fichier_name4): self
{
$this->fichier_name4 = $fichier_name4;
return $this;
}
public function __toString(): string
{
return (string) $this->titre;
}
public function getUrlFichierExt(): ?string
{
return $this->url_fichier_ext;
}
public function setUrlFichierExt(?string $url_fichier_ext): self
{
$this->url_fichier_ext = $url_fichier_ext;
return $this;
}
public function getStatut(): ?Statut
{
return $this->statut;
}
public function setStatut(?Statut $statut): self
{
$this->statut = $statut;
return $this;
}
public function getAliasUrl(): ?string
{
return $this->alias_url;
}
public function setAliasUrl(?string $alias_url): self
{
$this->alias_url = $alias_url;
return $this;
}
public function getDescriptionAccessibilite(): ?string
{
return $this->description_accessibilite;
}
public function setDescriptionAccessibilite(?string $description_accessibilite): self
{
$this->description_accessibilite = $description_accessibilite;
return $this;
}
public function getLibelleFichier1(): ?string
{
return $this->libelle_fichier1;
}
public function setLibelleFichier1(?string $libelle_fichier1): self
{
$this->libelle_fichier1 = $libelle_fichier1;
return $this;
}
public function getLibelleFichier2(): ?string
{
return $this->libelle_fichier2;
}
public function setLibelleFichier2(?string $libelle_fichier2): self
{
$this->libelle_fichier2 = $libelle_fichier2;
return $this;
}
public function getLibelleFichier3(): ?string
{
return $this->libelle_fichier3;
}
public function setLibelleFichier3(?string $libelle_fichier3): self
{
$this->libelle_fichier3 = $libelle_fichier3;
return $this;
}
public function getLibelleFichier4(): ?string
{
return $this->libelle_fichier4;
}
public function setLibelleFichier4(?string $libelle_fichier4): self
{
$this->libelle_fichier4 = $libelle_fichier4;
return $this;
}
public function getFichierName5(): ?string
{
return $this->fichier_name5;
}
public function setFichierName5(?string $fichier_name5): self
{
$this->fichier_name5 = $fichier_name5;
return $this;
}
public function getFichierName6(): ?string
{
return $this->fichier_name6;
}
public function setFichierName6(?string $fichier_name6): self
{
$this->fichier_name6 = $fichier_name6;
return $this;
}
public function getLibelleFichier5(): ?string
{
return $this->libelle_fichier5;
}
public function setLibelleFichier5(?string $libelle_fichier5): self
{
$this->libelle_fichier5 = $libelle_fichier5;
return $this;
}
public function getLibelleFichier6(): ?string
{
return $this->libelle_fichier6;
}
public function setLibelleFichier6(?string $libelle_fichier6): self
{
$this->libelle_fichier6 = $libelle_fichier6;
return $this;
}
public function setFichier5(File $file = null): void
{
$this->fichier5 = $file;
if ($file) {
$this->date_update = new \DateTime;
}
}
public function getFichier5(): mixed
{
return $this->fichier5;
}
public function setFichier6(File $file = null): void
{
$this->fichier6 = $file;
if ($file) {
$this->date_update = new \DateTime;
}
}
public function getFichier6(): mixed
{
return $this->fichier6;
}
public function getPoids2(): ?string
{
return $this->poids2;
}
public function setPoids2(?string $poids2): self
{
$this->poids2 = $poids2;
return $this;
}
public function getPoids3(): ?string
{
return $this->poids3;
}
public function setPoids3(?string $poids3): self
{
$this->poids3 = $poids3;
return $this;
}
public function getPoids4(): ?string
{
return $this->poids4;
}
public function setPoids4(?string $poids4): self
{
$this->poids4 = $poids4;
return $this;
}
public function getPoids5(): ?string
{
return $this->poids5;
}
public function setPoids5(?string $poids5): self
{
$this->poids5 = $poids5;
return $this;
}
public function getPoids6(): ?string
{
return $this->poids6;
}
public function setPoids6(?string $poids6): self
{
$this->poids6 = $poids6;
return $this;
}
public function getFormatFile2(): ?string
{
return $this->format_file2;
}
public function setFormatFile2(?string $format_file2): self
{
$this->format_file2 = $format_file2;
return $this;
}
public function getFormatFile3(): ?string
{
return $this->format_file3;
}
public function setFormatFile3(?string $format_file3): self
{
$this->format_file3 = $format_file3;
return $this;
}
public function getFormatFile4(): ?string
{
return $this->format_file4;
}
public function setFormatFile4(?string $format_file4): self
{
$this->format_file4 = $format_file4;
return $this;
}
public function getFormatFile5(): ?string
{
return $this->format_file5;
}
public function setFormatFile5(?string $format_file5): self
{
$this->format_file5 = $format_file5;
return $this;
}
public function getFormatFile6(): ?string
{
return $this->format_file6;
}
public function setFormatFile6(?string $format_file6): self
{
$this->format_file6 = $format_file6;
return $this;
}
/**
* @return Collection|Epingle[]
*/
public function getEpingles(): Collection
{
return $this->epingles;
}
public function addEpingle(Epingle $epingle): self
{
if (!$this->epingles->contains($epingle)) {
$this->epingles[] = $epingle;
$epingle->addVisibleDocument($this);
}
return $this;
}
public function removeEpingle(Epingle $epingle): self
{
if ($this->epingles->removeElement($epingle)) {
$epingle->removeVisibleDocument($this);
}
return $this;
}
public function getAnnexeUrl(): ?string
{
return $this->annexe_url;
}
public function setAnnexeUrl(?string $annexe_url): self
{
$this->annexe_url = $annexe_url;
return $this;
}
public function isImport(): ?bool
{
return $this->import;
}
public function setImport(?bool $import): self
{
$this->import = $import;
return $this;
}
/**
* @return Collection<int, PageSatellite>
*/
public function getPageSatellites(): Collection
{
return $this->pageSatellites;
}
public function addPageSatellite(PageSatellite $pageSatellite): self
{
if (!$this->pageSatellites->contains($pageSatellite)) {
$this->pageSatellites->add($pageSatellite);
$pageSatellite->addDocument($this);
}
return $this;
}
public function removePageSatellite(PageSatellite $pageSatellite): self
{
if ($this->pageSatellites->removeElement($pageSatellite)) {
$pageSatellite->removeDocument($this);
}
return $this;
}
}