<?php
namespace App\Entity;
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\CabinetRepository")
* @Vich\Uploadable
*/
class Cabinet
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $titre;
/**
* @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;
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 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;
}
}