<?php
namespace App\Entity;
use App\Repository\ImageAnnoncesRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=ImageAnnoncesRepository::class)
*/
class ImageAnnonces
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\File(
* maxSize = "400k",
* mimeTypes = {"image/jpeg", "image/gif", "image/png", "image/tiff"},
* maxSizeMessage = "Le fichier est trop volumineux. Sa taille ne doit pas dépasser 2 MiB",
* mimeTypesMessage = "Only the filetypes image are allowed."
* )
*/
private $url;
/**
* @ORM\ManyToOne(targetEntity=Annonce::class, inversedBy="imageAnnonces")
*/
private $annonce;
public function getId(): ?int
{
return $this->id;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
public function getAnnonce(): ?Annonce
{
return $this->annonce;
}
public function setAnnonce(?Annonce $annonce): self
{
$this->annonce = $annonce;
return $this;
}
}