src/Flexy/ShopBundle/Entity/Order/GallerieHome.php line 14

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Order;
  3. use App\Flexy\ShopBundle\Repository\Order\GallerieHomeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. /**
  8.  * @Vich\Uploadable
  9.  */
  10. #[ORM\Entity(repositoryClassGallerieHomeRepository::class)]
  11. class GallerieHome
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\ManyToOne(inversedBy'gallerieHomes'cascade: ['persist'])]
  18.     private ?HomePage $carouselHome null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $path null;
  21.     
  22.     
  23.     
  24.     /**
  25.      * @Vich\UploadableField(mapping="product_images_home", fileNameProperty="path")
  26.      */
  27.     private ?\Symfony\Component\HttpFoundation\File\File $imageFile null;
  28.     public function getId(): ?int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getCarouselHome(): ?HomePage
  33.     {
  34.         return $this->carouselHome;
  35.     }
  36.     public function setCarouselHome(?HomePage $carouselHome): static
  37.     {
  38.         $this->carouselHome $carouselHome;
  39.         return $this;
  40.     }
  41.     public function getPath(): ?string
  42.     {
  43.         return $this->path;
  44.     }
  45.     public function setPath(?string $path): static
  46.     {
  47.         $this->path $path;
  48.         return $this;
  49.     }
  50.     
  51.     
  52.           public function setImageFile(File $path null)
  53.         {
  54.             $this->imageFile $path;
  55.     
  56.         
  57.             // if ($path) {
  58.             //     // if 'updatedAt' is not defined in your entity, use another property
  59.             //     $this->updatedAt = new \DateTime('now');
  60.             // }
  61.         }
  62.     
  63.         public function getImageFile()
  64.         {
  65.             return $this->imageFile;
  66.         }
  67. }