src/Entity/ImageAnnonces.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImageAnnoncesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ImageAnnoncesRepository::class)
  8.  */
  9. class ImageAnnonces
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      * @Assert\File(
  20.      *     maxSize = "400k",
  21.      *     mimeTypes = {"image/jpeg", "image/gif", "image/png", "image/tiff"},
  22.      *     maxSizeMessage = "Le fichier est trop volumineux. Sa taille ne doit pas dépasser 2 MiB",
  23.      *     mimeTypesMessage = "Only the filetypes image are allowed."
  24.      * )
  25.      */
  26.     private $url;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Annonce::class, inversedBy="imageAnnonces")
  29.      */
  30.     private $annonce;
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getUrl(): ?string
  36.     {
  37.         return $this->url;
  38.     }
  39.     public function setUrl(?string $url): self
  40.     {
  41.         $this->url $url;
  42.         return $this;
  43.     }
  44.     public function getAnnonce(): ?Annonce
  45.     {
  46.         return $this->annonce;
  47.     }
  48.     public function setAnnonce(?Annonce $annonce): self
  49.     {
  50.         $this->annonce $annonce;
  51.         return $this;
  52.     }
  53. }