<?php
namespace App\Entity;
use ORM\CustomIdGenerator;
use Symfony\Component\Uid\Uuid;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\OldMinistreRepository")
* @Vich\Uploadable
*/
class OldMinistre
{
/**
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $fullname;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*
*/
private $photo;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Url(message="Entrez un lien valide")
*/
private $lienFacebook;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Url(message="Entrez un lien valide")
*/
private $lienLinkdln;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Url(message="Entrez un lien valide")
*/
private $lienTwitter;
/**
* @Assert\File(
* mimeTypes = {"image/png", "image/gif", "image/jpeg", "image/jpg"},
* mimeTypesMessage = "SVP seuls les fichiers image d'extension png, gif, jpeg et jpg sont requis."
* )
* @Vich\UploadableField(mapping="medias", fileNameProperty="photo")
* @var File
*/
private $nameImage;
/**
* @ORM\Column(type="date")
*/
private $startdate;
/**
* @ORM\Column(type="date")
*/
private $enddate;
/**
* @ORM\Column(type="uuid", unique=true)
*/
private $uid;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $biographie;
public function __construct()
{
$this->uid = Uuid::v4();
$this->id = Uuid::v4();
}
public function getId(): ?uuid
{
return $this->id;
}
public function getFullname(): ?string
{
return $this->fullname;
}
public function setFullname(string $fullname): self
{
$this->fullname = $fullname;
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): self
{
$this->photo = $photo;
return $this;
}
public function getLienFacebook(): ?string
{
return $this->lienFacebook;
}
public function setLienFacebook(?string $lienFacebook): self
{
$this->lienFacebook = $lienFacebook;
return $this;
}
public function getLienLinkdln(): ?string
{
return $this->lienLinkdln;
}
public function setLienLinkdln(?string $lienLinkdln): self
{
$this->lienLinkdln = $lienLinkdln;
return $this;
}
public function getLienTwitter(): ?string
{
return $this->lienTwitter;
}
public function setLienTwitter(?string $lienTwitter): self
{
$this->lienTwitter = $lienTwitter;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $nameImage
*/
public function setNameImage(?File $nameImage = null): void
{
$this->nameImage = $nameImage;
}
public function getNameImage(): ?File
{
return $this->nameImage;
}
public function getStartdate(): ?\DateTimeInterface
{
return $this->startdate;
}
public function setStartdate(\DateTimeInterface $startdate): self
{
$this->startdate = $startdate;
return $this;
}
public function getEnddate(): ?\DateTimeInterface
{
return $this->enddate;
}
public function setEnddate(\DateTimeInterface $enddate): self
{
$this->enddate = $enddate;
return $this;
}
public function getUid(): ?string
{
return $this->uid;
}
public function setUid(string $uid): self
{
$this->uid = $uid;
return $this;
}
public function getBiographie(): ?string
{
return $this->biographie;
}
public function setBiographie(?string $biographie): self
{
$this->biographie = $biographie;
return $this;
}
}