src/Entity/VideoOnpc.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VideoOnpcRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @ORM\Entity(repositoryClass=VideoOnpcRepository::class)
  11.  * @ORM\Table(name="video_onpc")
  12.  * @Vich\Uploadable
  13.  */
  14. class VideoOnpc
  15. {
  16.     /**
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $titre;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      */
  29.     private $idVimeo;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $description;
  34.     /**
  35.      * @ORM\Column(type="string", length=100, nullable=true)
  36.      */
  37.     private $tag;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $photo;
  42.     /**
  43.      * @Vich\UploadableField(mapping="video_photo", fileNameProperty="photo")
  44.      * @var File|null
  45.      */
  46.     private $photoFile;
  47.     /**
  48.      * @ORM\Column(type="datetime")
  49.      */
  50.     private $createdAt;
  51.     /**
  52.      * @ORM\Column(type="string", length=50, nullable=true)
  53.      */
  54.     private $duree;
  55.     /**
  56.      * @ORM\Column(type="boolean", nullable=true)
  57.      */
  58.     private $isCarrousel;
  59.     /**
  60.      * @ORM\ManyToMany(targetEntity=Etablissement::class, inversedBy="videosOnpc")
  61.      */
  62.     private $annonceurs// n'est pas utilisée, affichage trop lors dans l'admin (car beaucoup d'établissements)
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      */
  66.     private $idsAnnonceur;
  67.     /**
  68.      * @ORM\Column(type="string", length=255)
  69.      */
  70.     private $slug;
  71.     /**
  72.      * @ORM\Column(type="datetime", nullable=true)
  73.      */
  74.     private $updatedAt;
  75.     public function __construct()
  76.     {
  77.         $this->annonceurs = new ArrayCollection();
  78.         $this->createdAt = new \DateTime();
  79.     }
  80.     public function getId(): ?int
  81.     {
  82.         return $this->id;
  83.     }
  84.     public function getTitre(): ?string
  85.     {
  86.         return $this->titre;
  87.     }
  88.     public function setTitre(string $titre): self
  89.     {
  90.         $this->titre $titre;
  91.         return $this;
  92.     }
  93.     public function getIdVimeo(): ?string
  94.     {
  95.         return $this->idVimeo;
  96.     }
  97.     public function setIdVimeo(string $idVimeo): self
  98.     {
  99.         $this->idVimeo $idVimeo;
  100.         return $this;
  101.     }
  102.     public function getDescription(): ?string
  103.     {
  104.         return $this->description;
  105.     }
  106.     public function setDescription(?string $description): self
  107.     {
  108.         $this->description $description;
  109.         return $this;
  110.     }
  111.     public function getTag(): ?string
  112.     {
  113.         return $this->tag;
  114.     }
  115.     public function setTag(?string $tag): self
  116.     {
  117.         $this->tag $tag;
  118.         return $this;
  119.     }
  120.     public function getPhoto(): ?string
  121.     {
  122.         return $this->photo;
  123.     }
  124.     public function setPhoto(?string $photo): self
  125.     {
  126.         $this->photo $photo;
  127.         return $this;
  128.     }
  129.     public function getPhotoFile(): ?File
  130.     {
  131.         return $this->photoFile;
  132.     }
  133.     public function setPhotoFile(?File $photoFile null): void
  134.     {
  135.         $this->photoFile $photoFile;
  136.         if (null !== $photoFile) {
  137.             // It is required that at least one field changes if you are using doctrine
  138.             // otherwise the event listeners won't be called and the file is lost
  139.             $this->updatedAt = new \DateTime();
  140.         }
  141.     }
  142.     public function getCreatedAt(): ?\DateTimeInterface
  143.     {
  144.         return $this->createdAt;
  145.     }
  146.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  147.     {
  148.         $this->createdAt $createdAt;
  149.         return $this;
  150.     }
  151.     public function getDuree(): ?string
  152.     {
  153.         return $this->duree;
  154.     }
  155.     public function setDuree(?string $duree): self
  156.     {
  157.         $this->duree $duree;
  158.         return $this;
  159.     }
  160.     public function isIsCarrousel(): ?bool
  161.     {
  162.         return $this->isCarrousel;
  163.     }
  164.     public function setIsCarrousel(?bool $isCarrousel): self
  165.     {
  166.         $this->isCarrousel $isCarrousel;
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return Collection<int, Etablissement>
  171.      */
  172.     public function getAnnonceurs(): Collection
  173.     {
  174.         return $this->annonceurs;
  175.     }
  176.     public function addAnnonceur(Etablissement $annonceur): self
  177.     {
  178.         if (!$this->annonceurs->contains($annonceur)) {
  179.             $this->annonceurs[] = $annonceur;
  180.         }
  181.         return $this;
  182.     }
  183.     public function removeAnnonceur(Etablissement $annonceur): self
  184.     {
  185.         $this->annonceurs->removeElement($annonceur);
  186.         return $this;
  187.     }
  188.     public function getIdsAnnonceur(): ?string
  189.     {
  190.         return $this->idsAnnonceur;
  191.     }
  192.     public function setIdsAnnonceur(?string $idsAnnonceur): self
  193.     {
  194.         $this->idsAnnonceur $idsAnnonceur;
  195.         return $this;
  196.     }
  197.     public function getSlug(): ?string
  198.     {
  199.         return $this->slug;
  200.     }
  201.     public function setSlug(string $slug): self
  202.     {
  203.         $this->slug $slug;
  204.         return $this;
  205.     }
  206.     public function getUpdatedAt(): ?\DateTimeInterface
  207.     {
  208.         return $this->updatedAt;
  209.     }
  210.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  211.     {
  212.         $this->updatedAt $updatedAt;
  213.         return $this;
  214.     }
  215. }