src/Entity/ActualiteOnpc.php line 17

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