<?php
namespace App\Entity;
use App\Repository\ClientRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ClientRepository::class)
*/
class Client
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $nom;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $image;
/**
* @ORM\Column(type="boolean")
*/
private $afficherDansLesClients;
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function __toString(){
return $this->nom;
}
public function getAfficherDansLesClients(): ?bool
{
return $this->afficherDansLesClients;
}
public function setAfficherDansLesClients(bool $afficherDansLesClients): self
{
$this->afficherDansLesClients = $afficherDansLesClients;
return $this;
}
public function getAbsoluteImage() : ?string
{
if(!empty($this->image)){
return sprintf("https://%s/images/upload/%s",$_SERVER['HTTP_HOST'],$this->image);
}
return null;
}
}