src/Entity/Magasin.php line 16

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MagasinRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\DBAL\Types\Types;
  6. use App\Entity\Traits\Timestamp;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. #[ORM\HasLifecycleCallbacks]
  11. #[Vich\Uploadable]
  12. #[ORM\Entity(repositoryClassMagasinRepository::class)]
  13. class Magasin
  14. {
  15.     use Timestamp;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $title null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $localisation null;
  24.     /**
  25.      * @var File|null
  26.      **/
  27.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  28.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  29.     #[Vich\UploadableField(mapping'magasins'fileNameProperty'image')]
  30.     private $imageFile;
  31.     #[ORM\Column(length255,nullabletrue)]
  32.     private ?string $image null;
  33.     /**
  34.      * @var File|null
  35.      **/
  36.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  37.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  38.     #[Vich\UploadableField(mapping'magasins'fileNameProperty'image1')]
  39.     private $imageFile1;
  40.     #[ORM\Column(length255,nullabletrue)]
  41.     private ?string $image1 null;
  42.     /**
  43.      * @var File|null
  44.      **/
  45.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  46.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  47.     #[Vich\UploadableField(mapping'magasins'fileNameProperty'image2')]
  48.     private $imageFile2;
  49.     #[ORM\Column(length255,nullabletrue)]
  50.     private ?string $image2 null;
  51.     /**
  52.      * @var File|null
  53.      **/
  54.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  55.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  56.     #[Vich\UploadableField(mapping'magasins'fileNameProperty'image3')]
  57.     private $imageFile3;
  58.     #[ORM\Column(length255,nullabletrue)]
  59.     private ?string $image3 null;
  60.     /**
  61.      * @var File|null
  62.      **/
  63.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  64.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  65.     #[Vich\UploadableField(mapping'magasins'fileNameProperty'image4')]
  66.     private $imageFile4;
  67.     #[ORM\Column(length255,nullabletrue)]
  68.     private ?string $image4 null;
  69.     #[ORM\Column(length255)]
  70.     private ?string $slug null;
  71.     #[ORM\Column(nullabletrue)]
  72.     private ?bool $online null;
  73.     #[ORM\Column(nullabletrue)]
  74.     private ?int $position null;
  75.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  76.     private ?string $description null;
  77.     #[ORM\Column(length255nullabletrue)]
  78.     private ?string $telephone null;
  79.     #[ORM\Column(length255nullabletrue)]
  80.     private ?string $horaire null;
  81.     public function getId(): ?int
  82.     {
  83.         return $this->id;
  84.     }
  85.     public function getTitle(): ?string
  86.     {
  87.         return $this->title;
  88.     }
  89.     public function setTitle(string $title): static
  90.     {
  91.         $this->title $title;
  92.         return $this;
  93.     }
  94.     public function getLocalisation(): ?string
  95.     {
  96.         return $this->localisation;
  97.     }
  98.     public function setLocalisation(string $localisation): static
  99.     {
  100.         $this->localisation $localisation;
  101.         return $this;
  102.     }
  103.     public function getImage(): ?string
  104.     {
  105.         return $this->image;
  106.     }
  107.     public function setImage(?string $image): self
  108.     {
  109.         $this->image $image;
  110.         return $this;
  111.     }
  112.     public function getImage1(): ?string
  113.     {
  114.         return $this->image1;
  115.     }
  116.     public function setImage1(?string $image1): self
  117.     {
  118.         $this->image1 $image1;
  119.         return $this;
  120.     }
  121.     public function getImage2(): ?string
  122.     {
  123.         return $this->image2;
  124.     }
  125.     public function setImage2(?string $image2): self
  126.     {
  127.         $this->image2 $image2;
  128.         return $this;
  129.     }
  130.     public function getImage3(): ?string
  131.     {
  132.         return $this->image3;
  133.     }
  134.     public function setImage3(?string $image3): self
  135.     {
  136.         $this->image3 $image3;
  137.         return $this;
  138.     }
  139.     public function getImage4(): ?string
  140.     {
  141.         return $this->image4;
  142.     }
  143.     public function setImage4(?string $image4): self
  144.     {
  145.         $this->image4 $image4;
  146.         return $this;
  147.     }
  148.     
  149.     /**
  150.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  151.      */
  152.     public function setImageFile(?File $imageFile null): void
  153.     {
  154.         $this->imageFile $imageFile;
  155.         if (null !== $imageFile) {
  156.             // It is required that at least one field changes if you are using doctrine
  157.             // otherwise the event listeners won't be called and the file is lost
  158.             $this->setUpdated(new \DateTimeImmutable());
  159.         }
  160.     }
  161.     public function getImageFile(): ?File
  162.     {
  163.         return $this->imageFile;
  164.     }
  165.     /**
  166.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile1
  167.      */
  168.     public function setImageFile1(?File $imageFile1 null): void
  169.     {
  170.         $this->imageFile1 $imageFile1;
  171.         if (null !== $imageFile1) {
  172.             // It is required that at least one field changes if you are using doctrine
  173.             // otherwise the event listeners won't be called and the file is lost
  174.             $this->setUpdated(new \DateTimeImmutable());
  175.         }
  176.     }
  177.     public function getImageFile1(): ?File
  178.     {
  179.         return $this->imageFile1;
  180.     }
  181.     /**
  182.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile2
  183.      */
  184.     public function setImageFile2(?File $imageFile2 null): void
  185.     {
  186.         $this->imageFile2 $imageFile2;
  187.         if (null !== $imageFile2) {
  188.             // It is required that at least one field changes if you are using doctrine
  189.             // otherwise the event listeners won't be called and the file is lost
  190.             $this->setUpdated(new \DateTimeImmutable());
  191.         }
  192.     }
  193.     public function getImageFile2(): ?File
  194.     {
  195.         return $this->imageFile2;
  196.     }
  197.     /**
  198.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile3
  199.      */
  200.     public function setImageFile3(?File $imageFile3 null): void
  201.     {
  202.         $this->imageFile3 $imageFile3;
  203.         if (null !== $imageFile3) {
  204.             // It is required that at least one field changes if you are using doctrine
  205.             // otherwise the event listeners won't be called and the file is lost
  206.             $this->setUpdated(new \DateTimeImmutable());
  207.         }
  208.     }
  209.     public function getImageFile3(): ?File
  210.     {
  211.         return $this->imageFile3;
  212.     }
  213.      /**
  214.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile4
  215.      */
  216.     public function setImageFile4(?File $imageFile4 null): void
  217.     {
  218.         $this->imageFile4 $imageFile4;
  219.         if (null !== $imageFile4) {
  220.             // It is required that at least one field changes if you are using doctrine
  221.             // otherwise the event listeners won't be called and the file is lost
  222.             $this->setUpdated(new \DateTimeImmutable());
  223.         }
  224.     }
  225.     public function getImageFile4(): ?File
  226.     {
  227.         return $this->imageFile4;
  228.     }
  229.     public function getSlug(): ?string
  230.     {
  231.         return $this->slug;
  232.     }
  233.     public function setSlug(string $slug): static
  234.     {
  235.         $this->slug $slug;
  236.         return $this;
  237.     }
  238.     public function isOnline(): ?bool
  239.     {
  240.         return $this->online;
  241.     }
  242.     public function setOnline(?bool $online): self
  243.     {
  244.         $this->online $online;
  245.         return $this;
  246.     }
  247.     public function getPosition(): ?int
  248.     {
  249.         return $this->position;
  250.     }
  251.     public function setPosition(?int $position): self
  252.     {
  253.         $this->position $position;
  254.         return $this;
  255.     }
  256.     public function __toString()
  257.     {
  258.         return $this->getTitle();
  259.     }
  260.     public function getDescription(): ?string
  261.     {
  262.         return $this->description;
  263.     }
  264.     public function setDescription(string $description): static
  265.     {
  266.         $this->description $description;
  267.         return $this;
  268.     }
  269.     public function getTelephone(): ?string
  270.     {
  271.         return $this->telephone;
  272.     }
  273.     public function setTelephone(string $telephone): static
  274.     {
  275.         $this->telephone $telephone;
  276.         return $this;
  277.     }
  278.     public function getHoraire(): ?string
  279.     {
  280.         return $this->horaire;
  281.     }
  282.     public function setHoraire(string $horaire): static
  283.     {
  284.         $this->horaire $horaire;
  285.         return $this;
  286.     }
  287. }