src/Entity/EvenementAVenir.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EvenementAVenirRepository;
  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. use ApiPlatform\Core\Annotation\ApiResource;
  10. /**
  11.  * @ORM\Entity(repositoryClass=EvenementAVenirRepository::class)
  12.  */
  13. /**
  14.  * @ApiResource
  15.  * @ORM\Entity
  16.  * @Vich\Uploadable
  17.  */
  18. class EvenementAVenir
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(type="string", length=200)
  28.      */
  29.     private $titre;
  30.     /**
  31.      * @ORM\Column(type="string", length=200)
  32.      */
  33.     private $category;
  34.      /**
  35.      * @ORM\Column(type="boolean")
  36.      */
  37.     private $desplay;
  38.     /**
  39.      * @ORM\Column(type="text")
  40.      */
  41.     private $Description;
  42.     /**
  43.      * @ORM\Column(type="string", length=255)
  44.      */
  45.     private $imagePrincipale;
  46.      /**
  47.      * @Vich\UploadableField(mapping="evenement_images_avenir", fileNameProperty="imagePrincipale")
  48.      * @var File
  49.      */
  50.     private $imageFile;
  51.     /**
  52.      * @ORM\Column(type="date")
  53.      */
  54.     private $DateEvenement;
  55.  
  56.      /**
  57.     * @ORM\OneToMany(targetEntity="Attachment",mappedBy="evenement",cascade={"remove","persist"})
  58.       */
  59.     private $attachments;
  60.          /**
  61.     * @ORM\OneToMany(targetEntity="PrixVariable",mappedBy="evenementprix",cascade={"remove","persist"})
  62.       */
  63.     private $prixvariables;
  64.      /**
  65.     * @ORM\ManyToOne(targetEntity="Event",inversedBy="newevenement")
  66.     */
  67.     private $evenementevent;
  68.     /**
  69.     * @ORM\OneToMany(targetEntity="PayementMethod",mappedBy="evenementautre",cascade={"remove","persist"})
  70.       */
  71.       private $evenementIdAutre;
  72.      /**
  73.     * @ORM\OneToMany(targetEntity="Document",mappedBy="documentautre",cascade={"remove","persist"})
  74.       */
  75.       private $evenementDocumentAutre;
  76.     public function __construct()
  77.     {
  78.         $this->attachments = new ArrayCollection();
  79.         $this->prixvariables = new ArrayCollection();
  80.     }
  81.     public function getId(): ?int
  82.     {
  83.         return $this->id;
  84.     }
  85.     
  86.     public function getTitre(): ?string
  87.     {
  88.         return $this->titre;
  89.     }
  90.     public function setTitre(string $titre): self
  91.     {
  92.         $this->titre $titre;
  93.         return $this;
  94.     }
  95.     
  96.     public function getCategory(): ?string
  97.     {
  98.         return $this->category;
  99.     }
  100.     public function setCategory(string $category): self
  101.     {
  102.         $this->category $category;
  103.         return $this;
  104.     }
  105.     public function getDescription(): ?string
  106.     {
  107.         return $this->Description;
  108.     }
  109.     public function setDescription(string $Description): self
  110.     {
  111.         $this->Description $Description;
  112.         return $this;
  113.     }
  114.     public function getImagePrincipale(): ?string
  115.     {
  116.         return $this->imagePrincipale;
  117.     }
  118.     public function setImagePrincipale(string $imagePrincipale): self
  119.     {
  120.         $this->imagePrincipale $imagePrincipale;
  121.         return $this;
  122.     }
  123.    
  124.     public function getDateEvenement(): ?\DateTimeInterface
  125.     {
  126.         return $this->DateEvenement;
  127.     }
  128.     public function setDateEvenement(\DateTimeInterface $DateEvenement): self
  129.     {
  130.         $this->DateEvenement $DateEvenement;
  131.         return $this;
  132.     }
  133.     /******* settter et getter des images ****/
  134.        public function setImageFile(File $image null)
  135.     {
  136.         $this->imageFile $image;
  137.         // VERY IMPORTANT:
  138.         // It is required that at least one field changes if you are using Doctrine,
  139.         // otherwise the event listeners won't be called and the file is lost
  140.         if ($image) {
  141.             // if 'updatedAt' is not defined in your entity, use another property
  142.             $this->updatedAt = new \DateTime('now');
  143.         }
  144.     }
  145.     public function getImageFile()
  146.     {
  147.         return $this->imageFile;
  148.     }
  149.     /**
  150.      * @return Collection|Attachment[]
  151.      */
  152.     public function getAttachments(): Collection
  153.     {
  154.         return $this->attachments;
  155.     }
  156.     public function addAttachment(Attachment $attachment): self
  157.     {
  158.         if (!$this->attachments->contains($attachment)) {
  159.             $this->attachments[] = $attachment;
  160.             $attachment->setEvenement($this);
  161.         }
  162.         return $this;
  163.     }
  164.     public function removeAttachment(Attachment $attachment): self
  165.     {
  166.         if ($this->attachments->removeElement($attachment)) {
  167.             // set the owning side to null (unless already changed)
  168.             if ($attachment->getEvenement() === $this) {
  169.                 $attachment->setEvenement(null);
  170.             }
  171.         }
  172.         return $this;
  173.     }
  174.     /**
  175.      * @return Collection|PrixVariable[]
  176.      */
  177.     public function getPrixvariables(): Collection
  178.     {
  179.         return $this->prixvariables;
  180.     }
  181.     public function addPrixvariable(PrixVariable $prixvariable): self
  182.     {
  183.         if (!$this->prixvariables->contains($prixvariable)) {
  184.             $this->prixvariables[] = $prixvariable;
  185.             $prixvariable->setEvenementprix($this);
  186.         }
  187.         return $this;
  188.     }
  189.     public function removePrixvariable(PrixVariable $prixvariable): self
  190.     {
  191.         if ($this->prixvariables->removeElement($prixvariable)) {
  192.             // set the owning side to null (unless already changed)
  193.             if ($prixvariable->getEvenementprix() === $this) {
  194.                 $prixvariable->setEvenementprix(null);
  195.             }
  196.         }
  197.         return $this;
  198.     }
  199.     public function getDesplay(): ?bool
  200.     {
  201.         return $this->desplay;
  202.     }
  203.     public function setDesplay(bool $desplay): self
  204.     {
  205.         $this->desplay $desplay;
  206.         return $this;
  207.     }
  208.     public function getEvenementevent(): ?Event
  209.     {
  210.         return $this->evenementevent;
  211.     }
  212.     public function setEvenementevent(?Event $evenementevent): self
  213.     {
  214.         $this->evenementevent $evenementevent;
  215.         return $this;
  216.     }
  217.     
  218.     public function __toString(): string
  219.     {
  220.         return $this->titre;
  221.     }
  222.        
  223.        
  224.       
  225.       
  226. }