src/Entity/Divertissement.php line 16
<?phpnamespace App\Entity;use App\Repository\DivertissementRepository;use Doctrine\ORM\Mapping as ORM;use App\Entity\Traits\Timestamp;use Doctrine\DBAL\Types\Types;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;#[ORM\HasLifecycleCallbacks]#[Vich\Uploadable]#[ORM\Entity(repositoryClass: DivertissementRepository::class)]class Divertissement{use Timestamp;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $title = null;#[ORM\Column(length: 255)]private ?string $localisation = null;#[ORM\Column(length: 255,nullable:true)]private ?string $image = null;/*** @var File|null**/#[Assert\Image(maxSize: '50M', maxSizeMessage: 'Image trop volumineuse maximum 10Mb')]#[Assert\Image(mimeTypes: ["image/jpeg", "image/jpg", "image/png"], mimeTypesMessage: "Mauvais format d'image (jpeg, jpg et png)")]#[Vich\UploadableField(mapping: 'divertissements', fileNameProperty: 'image')]private $imageFile;#[ORM\Column(length: 255)]private ?string $slug = null;#[ORM\Column(nullable: true)]private ?bool $online = null;#[ORM\Column(nullable: true)]private ?int $position = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(length: 255, nullable: true)]private ?string $telephone = null;#[ORM\Column(length: 255, nullable: true)]private ?string $horaire = null;public function getId(): ?int{return $this->id;}public function getTitle(): ?string{return $this->title;}public function setTitle(string $title): static{$this->title = $title;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(string $description): static{$this->description = $description;return $this;}public function getLocalisation(): ?string{return $this->localisation;}public function setLocalisation(string $localisation): static{$this->localisation = $localisation;return $this;}public function getImage(): ?string{return $this->image;}public function setImage(?string $image): self{$this->image = $image;return $this;}/*** @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile*/public function setImageFile(?File $imageFile = null): void{$this->imageFile = $imageFile;if (null !== $imageFile) {// It is required that at least one field changes if you are using doctrine// otherwise the event listeners won't be called and the file is lost$this->setUpdated(new \DateTimeImmutable());}}public function getImageFile(): ?File{return $this->imageFile;}public function getSlug(): ?string{return $this->slug;}public function setSlug(string $slug): static{$this->slug = $slug;return $this;}public function isOnline(): ?bool{return $this->online;}public function setOnline(?bool $online): self{$this->online = $online;return $this;}public function getPosition(): ?int{return $this->position;}public function setPosition(?int $position): self{$this->position = $position;return $this;}public function __toString(){return $this->getTitle();}public function getTelephone(): ?string{return $this->telephone;}public function setTelephone(string $telephone): static{$this->telephone = $telephone;return $this;}public function getHoraire(): ?string{return $this->horaire;}public function setHoraire(string $horaire): static{$this->horaire = $horaire;return $this;}}