<?php
namespace App\Entity;
use App\Repository\NosChiffresClesRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NosChiffresClesRepository::class)
*/
class NosChiffresCles
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable="true")
*/
private $titre;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $contenu;
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 getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getContenu(): ?string
{
return $this->contenu;
}
public function setContenu(?string $contenu): self
{
$this->contenu = $contenu;
return $this;
}
public function getAbsoluteImage() : ?string
{
if(!empty($this->image)){
return sprintf("https://%s/websiteImage/%s",$_SERVER['HTTP_HOST'],$this->image);
}
return null;
}
}