src/Entity/Membre.php line 16
<?phpnamespace App\Entity;use App\Entity\Traits\Timestamp;use App\Repository\MembreRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Symfony\Component\HttpFoundation\File\UploadedFile;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: MembreRepository::class)]#[ORM\HasLifecycleCallbacks]#[Vich\Uploadable]class Membre{use Timestamp;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;/*** @var File|null**/#[Assert\Image(maxSize: '50M', maxSizeMessage: 'Image trop volumineuse maximum 10Mb')]#[Assert\Image(mimeTypes: ["image/jpeg", "image/jpg", "image/png"], mimeTypesMessage: "Mauvais format d'image (jpeg, jpg et png)")]#[Vich\UploadableField(mapping: 'membres', fileNameProperty: 'image')]private $imageFile;#[ORM\Column(length: 255, nullable: true)]private ?string $image = null;#[ORM\Column(length: 80)]private ?string $nom = null;#[ORM\Column(length: 80, nullable: true)]private ?string $fonction = null;#[ORM\Column]private ?bool $online = null;public function getId(): ?int{return $this->id;}public function getImage(): ?string{return $this->image;}public function setImage(?string $image): self{$this->image = $image;return $this;}public function getNom(): ?string{return $this->nom;}public function setNom(string $nom): self{$this->nom = $nom;return $this;}public function getFonction(): ?string{return $this->fonction;}public function setFonction(?string $fonction): self{$this->fonction = $fonction;return $this;}public function isOnline(): ?bool{return $this->online;}public function setOnline(bool $online): self{$this->online = $online;return $this;}/*** @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile*/public function setImageFile(?File $imageFile = null): void{$this->imageFile = $imageFile;if (null !== $imageFile) {// It is required that at least one field changes if you are using doctrine// otherwise the event listeners won't be called and the file is lost$this->setUpdated(new \DateTimeImmutable());}}public function getImageFile(): ?File{return $this->imageFile;}public function __toString(){return $this->getNom();}}