src/Entity/TemplateFichier.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TemplateFichierRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTemplateFichierRepository::class)]
  8. #[ORM\Table(name'template_fichier')]
  9. class TemplateFichier
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column]
  16.     private ?int $societe null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $titre null;
  19.     #[ORM\Column(length500)]
  20.     private ?string $fichier_emplacement null;
  21.     #[ORM\Column(length10options: ['default' => 'pdf'])]
  22.     private string $extension 'pdf';
  23.     #[ORM\Column(options: ['default' => 300])]
  24.     private int $dpi 300;
  25.     #[ORM\Column(type'json'nullabletrue)]
  26.     private ?array $pages null;
  27.     #[ORM\OneToMany(mappedBy'fichier'targetEntityTemplateDocument::class, cascade: ['persist''remove'])]
  28.     private Collection $templateDocuments;
  29.     public function __construct()
  30.     {
  31.         $this->templateDocuments = new ArrayCollection();
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getSociete(): ?int
  38.     {
  39.         return $this->societe;
  40.     }
  41.     public function setSociete(int $societe): static
  42.     {
  43.         $this->societe $societe;
  44.         return $this;
  45.     }
  46.     public function getTitre(): ?string
  47.     {
  48.         return $this->titre;
  49.     }
  50.     public function setTitre(string $titre): static
  51.     {
  52.         $this->titre $titre;
  53.         return $this;
  54.     }
  55.     public function getFichierEmplacement(): ?string
  56.     {
  57.         return $this->fichier_emplacement;
  58.     }
  59.     public function setFichierEmplacement(string $fichier_emplacement): static
  60.     {
  61.         $this->fichier_emplacement $fichier_emplacement;
  62.         return $this;
  63.     }
  64.     public function getExtension(): string
  65.     {
  66.         return $this->extension;
  67.     }
  68.     public function setExtension(string $extension): static
  69.     {
  70.         $this->extension $extension;
  71.         return $this;
  72.     }
  73.     public function getDpi(): int
  74.     {
  75.         return $this->dpi;
  76.     }
  77.     public function setDpi(int $dpi): static
  78.     {
  79.         $this->dpi $dpi;
  80.         return $this;
  81.     }
  82.     public function getPages(): array
  83.     {
  84.         return $this->pages ?? [];
  85.     }
  86.     public function setPages(array $pages): static
  87.     {
  88.         $this->pages $pages;
  89.         return $this;
  90.     }
  91.     /**
  92.      * @return Collection<int, TemplateDocument>
  93.      */
  94.     public function getTemplateDocuments(): Collection
  95.     {
  96.         return $this->templateDocuments;
  97.     }
  98.     public function addTemplateDocument(TemplateDocument $templateDocument): static
  99.     {
  100.         if (!$this->templateDocuments->contains($templateDocument)) {
  101.             $this->templateDocuments->add($templateDocument);
  102.             $templateDocument->setFichier($this);
  103.         }
  104.         return $this;
  105.     }
  106.     public function removeTemplateDocument(TemplateDocument $templateDocument): static
  107.     {
  108.         if ($this->templateDocuments->removeElement($templateDocument)) {
  109.             if ($templateDocument->getFichier() === $this) {
  110.                 $templateDocument->setFichier(null);
  111.             }
  112.         }
  113.         return $this;
  114.     }
  115. }