src/Entity/Banque.php line 16

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BanqueRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\Traits\Timestamp;
  6. use Doctrine\DBAL\Types\Types;
  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\Entity(repositoryClassBanqueRepository::class)]
  11. #[ORM\HasLifecycleCallbacks]
  12. #[Vich\Uploadable]
  13. class Banque
  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.     #[ORM\Column(length255nullable:true)]
  25.     private ?string $image null;
  26.      /**
  27.      * @var File|null
  28.      **/
  29.     #[Assert\Image(maxSize'50M'maxSizeMessage'Image trop volumineuse maximum 10Mb')]
  30.     #[Assert\Image(mimeTypes: ["image/jpeg""image/jpg""image/png"], mimeTypesMessage"Mauvais format d'image (jpeg, jpg et png)")]
  31.     #[Vich\UploadableField(mapping'banques'fileNameProperty'image')]
  32.     private $imageFile;
  33.     #[ORM\Column(length255)]
  34.     private ?string $slug null;
  35.     #[ORM\Column(nullabletrue)]
  36.     private ?bool $online null;
  37.     #[ORM\Column(nullabletrue)]
  38.     private ?int $position null;
  39.     #[ORM\Column(typeTypes::TEXT)]
  40.     private ?string $description null;
  41.     #[ORM\Column(length255)]
  42.     private ?string $telephone null;
  43.     #[ORM\Column(length255)]
  44.     private ?string $horaire null;
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getTitle(): ?string
  50.     {
  51.         return $this->title;
  52.     }
  53.     public function setTitle(string $title): static
  54.     {
  55.         $this->title $title;
  56.         return $this;
  57.     }
  58.     public function getTelephone(): ?string
  59.     {
  60.         return $this->telephone;
  61.     }
  62.     public function setTelephone(string $telephone): static
  63.     {
  64.         $this->telephone $telephone;
  65.         return $this;
  66.     }
  67.     public function getHoraire(): ?string
  68.     {
  69.         return $this->horaire;
  70.     }
  71.     public function setHoraire(string $horaire): static
  72.     {
  73.         $this->horaire $horaire;
  74.         return $this;
  75.     }
  76.     public function getLocalisation(): ?string
  77.     {
  78.         return $this->localisation;
  79.     }
  80.     public function setLocalisation(string $localisation): static
  81.     {
  82.         $this->localisation $localisation;
  83.         return $this;
  84.     }
  85.     public function getImage(): ?string
  86.     {
  87.         return $this->image;
  88.     }
  89.     public function setImage(?string $image): self
  90.     {
  91.         $this->image $image;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  96.      */
  97.     public function setImageFile(?File $imageFile null): void
  98.     {
  99.         $this->imageFile $imageFile;
  100.         if (null !== $imageFile) {
  101.             // It is required that at least one field changes if you are using doctrine
  102.             // otherwise the event listeners won't be called and the file is lost
  103.             $this->setUpdated(new \DateTimeImmutable());
  104.         }
  105.     }
  106.     public function getImageFile(): ?File
  107.     {
  108.         return $this->imageFile;
  109.     }
  110.     public function getSlug(): ?string
  111.     {
  112.         return $this->slug;
  113.     }
  114.     public function setSlug(string $slug): static
  115.     {
  116.         $this->slug $slug;
  117.         return $this;
  118.     }
  119.     public function __toString()
  120.     {
  121.         return $this->getTitle();
  122.     }
  123.     public function isOnline(): ?bool
  124.     {
  125.         return $this->online;
  126.     }
  127.     public function setOnline(?bool $online): self
  128.     {
  129.         $this->online $online;
  130.         return $this;
  131.     }
  132.     public function getPosition(): ?int
  133.     {
  134.         return $this->position;
  135.     }
  136.     public function setPosition(?int $position): self
  137.     {
  138.         $this->position $position;
  139.         return $this;
  140.     }
  141.     public function getDescription(): ?string
  142.     {
  143.         return $this->description;
  144.     }
  145.     public function setDescription(string $description): static
  146.     {
  147.         $this->description $description;
  148.         return $this;
  149.     }
  150.     
  151. }