src/Entity/Document.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocumentRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. /**
  9.  * @ORM\Entity(repositoryClass=DocumentRepository::class)
  10.  * @Vich\Uploadable
  11.  * @Assert\Callback("App\Validator\FileValidator", "validate")
  12.  */
  13. class Document {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $lib;
  24.     /**
  25.      * @ORM\Column(type="string", length=255,nullable=false)
  26.      */
  27.     private $url;
  28.     /**
  29.      * 
  30.      * @Vich\UploadableField(mapping="Documents", fileNameProperty="url", size="docSise")
  31.      * @var File
  32.      * 
  33.      */
  34.     private $urlFile;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=Prestation::class, inversedBy="documents")
  37.      */
  38.     private $prestations;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity=Amicale::class, inversedBy="documents")
  41.      */
  42.     private $amicale;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=Fournisseur::class, inversedBy="documents")
  45.      */
  46.     private $fournisseur;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=Facture::class, inversedBy="documents")
  49.      */
  50.     private $facture;
  51.     /**
  52.      * @ORM\Column(type="integer", nullable=true)
  53.      */
  54.     private $docSise;
  55.     /**
  56.      * @ORM\Column(type="datetime_immutable", nullable=true)
  57.      */
  58.     private $updatedAt;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity=Enfant::class, inversedBy="documents")
  61.      */
  62.     private $enfant;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=RempoursementDette::class, inversedBy="documents")
  65.      */
  66.     private $rempoursementDette;
  67.     public function getId(): ?int {
  68.         return $this->id;
  69.     }
  70.     public function getLib(): ?string {
  71.         return $this->lib;
  72.     }
  73.     public function setLib(string $lib): self {
  74.         $this->lib = $lib;
  75.         return $this;
  76.     }
  77.     public function getUrl(): ?string {
  78.         return $this->url;
  79.     }
  80.     public function setUrl(?string $url): self {
  81.         $this->url = $url;
  82.         return $this;
  83.     }
  84.     public function getPrestations(): ?Prestation {
  85.         return $this->prestations;
  86.     }
  87.     public function setPrestations(?Prestation $prestations): self {
  88.         $this->prestations = $prestations;
  89.         return $this;
  90.     }
  91.     public function getAmicale(): ?Amicale {
  92.         return $this->amicale;
  93.     }
  94.     public function setAmicale(?Amicale $amicale): self {
  95.         $this->amicale = $amicale;
  96.         return $this;
  97.     }
  98.     public function getFournisseur(): ?Fournisseur {
  99.         return $this->fournisseur;
  100.     }
  101.     public function setFournisseur(?Fournisseur $fournisseur): self {
  102.         $this->fournisseur = $fournisseur;
  103.         return $this;
  104.     }
  105.     public function getFacture(): ?Facture {
  106.         return $this->facture;
  107.     }
  108.     public function setFacture(?Facture $facture): self {
  109.         $this->facture = $facture;
  110.         return $this;
  111.     }
  112.     public function getDocSise(): ?int {
  113.         return $this->docSise;
  114.     }
  115.     public function setDocSise(?int $docSise): self {
  116.         $this->docSise = $docSise;
  117.         return $this;
  118.     }
  119.     public function getUpdatedAt(): ?\DateTimeImmutable {
  120.         return $this->updatedAt;
  121.     }
  122.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self {
  123.         $this->updatedAt = $updatedAt;
  124.         return $this;
  125.     }
  126.     /**
  127.      *
  128.      * during Doctrine hydration.
  129.      *
  130.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $urlFile
  131.      */
  132.     public function setUrlFile(?File $urlFile): void {
  133.         $this->urlFile = $urlFile;
  134.         if (null !== $urlFile) {
  135.             $this->updatedAt = new \DateTimeImmutable();
  136.         }
  137.     }
  138.     public function getUrlFile(): ?File {
  139.         return $this->urlFile;
  140.     }
  141.     public function getEnfant(): ?Enfant
  142.     {
  143.         return $this->enfant;
  144.     }
  145.     public function setEnfant(?Enfant $enfant): self
  146.     {
  147.         $this->enfant = $enfant;
  148.         return $this;
  149.     }
  150.     public function getRempoursementDette(): ?RempoursementDette
  151.     {
  152.         return $this->rempoursementDette;
  153.     }
  154.     public function setRempoursementDette(?RempoursementDette $rempoursementDette): self
  155.     {
  156.         $this->rempoursementDette = $rempoursementDette;
  157.         return $this;
  158.     }
  159. }