src/Entity/BFDescriptionFestival.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\HttpFoundation\File\File;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\BFDescriptionFestivalRepository")
  8.  * @Vich\Uploadable
  9.  */
  10. class BFDescriptionFestival extends AbstractArrayAccess
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="text", nullable=true)
  20.      */
  21.     private $longdescription;
  22.     
  23.     /**
  24.      * @ORM\Column(type="string", length=255, nullable=true)
  25.      * @var string
  26.      */
  27.     private $image1;
  28.     /**
  29.      * @Vich\UploadableField(mapping="edition_images", fileNameProperty="image1")
  30.      * @var File
  31.      */
  32.     private $image1File;
  33.     
  34.     /**
  35.      * @ORM\Column(type="datetime", nullable=true)
  36.      * @var \DateTime
  37.      */
  38.     private $updatedAt1;
  39.     /**
  40.      * @ORM\OneToOne(targetEntity="App\Entity\BFFestival", mappedBy="description", cascade={"persist", "remove"})
  41.      */
  42.     private $festival;
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getLongdescription(): ?string
  48.     {
  49.         return $this->longdescription;
  50.     }
  51.     public function setLongdescription(?string $longdescription): self
  52.     {
  53.         $this->longdescription $longdescription;
  54.         return $this;
  55.     }
  56.     
  57.     public function setImage1File(File $image null)
  58.     {
  59.         $this->image1File $image;
  60.          
  61.          if ($image) {
  62.             $this->updatedAt1 = new \DateTime('now');
  63.         }
  64.     }
  65.     public function getImage1File()
  66.     {
  67.         return $this->image1File;
  68.     }
  69.     public function setImage1($image)
  70.     {
  71.         $this->image1 $image;
  72.     }
  73.     public function getImage1()
  74.     {
  75.         return $this->image1;
  76.     }
  77.     public function getFestival(): ?BFFestival
  78.     {
  79.         return $this->festival;
  80.     }
  81.     public function setFestival(BFFestival $festival): self
  82.     {
  83.         $this->festival $festival;
  84.         // set the owning side of the relation if necessary
  85.         if ($festival->getDescription() !== $this) {
  86.             $festival->setDescription($this);
  87.         }
  88.         return $this;
  89.     }
  90. }