<?phpnamespace App\Entity;use App\Repository\PresentationRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass=PresentationRepository::class) */class Presentation{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank() */ private $titre; /** * @ORM\Column(type="string", length=255,nullable="true") */ private $icone; /** * @ORM\Column(type="text") */ private $description; /** * @ORM\Column(type="boolean") */ private $sombre; /** * @ORM\Column(type="string", length=255) * @Assert\NotBlank() */ private $image; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $lien; public function getId(): ?int { return $this->id; } public function getTitre(): ?string { return $this->titre; } public function setTitre(string $titre): self { $this->titre = $titre; return $this; } public function getIcone(): ?string { return $this->icone; } public function setIcone(?string $icone): self { $this->icone = $icone; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } public function getSombre(): ?bool { return $this->sombre; } public function setSombre(bool $sombre): self { $this->sombre = $sombre; return $this; } public function getImage(): ?string { return $this->image; } public function setImage(?string $image): self { $this->image = $image; return $this; } public function getAbsoluteImage() : ?string { if(!empty($this->image)){ return sprintf("https://%s/websiteImage/%s",$_SERVER['HTTP_HOST'],$this->image); } return null; } public function getLien(): ?string { return $this->lien; } public function setLien(?string $lien): self { $this->lien = $lien; return $this; }}