src/Entity/Image.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ImageRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. #[ORM\Entity(repositoryClassImageRepository::class)]
  8. #[Vich\Uploadable]
  9. class Image
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     
  15.     private ?int $id null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $imageName null;
  18.     #[Vich\UploadableField(mapping'property_images'fileNameProperty'imageName')]
  19.     private ?File $imageFile null;
  20.     #[ORM\Column(nullabletrue)]
  21.     private ?\DateTimeImmutable $image_updatedAt null;
  22.     #[ORM\ManyToOne(inversedBy'images')]
  23.     private ?PropertyList $property_image null;
  24.     #[ORM\ManyToOne(inversedBy'images')]
  25.     private ?Bedroom $bedroom_image null;
  26.     #[ORM\Column(nullabletrue)]
  27.     #[ORM\OrderBy(["orden"=>"ASC"])]
  28.     private ?int $orden null;
  29.     private $esImagenHabitacion=null;
  30.     
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     
  36.     /**
  37.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  38.      */
  39.     public function setImageFile(?File $imageFile null): void
  40.     {
  41.         $this->imageFile $imageFile;
  42.         if (null !== $imageFile) {
  43.             $this->image_updatedAt = new \DateTimeImmutable();
  44.         }
  45.     }
  46.     public function getImageFile(): ?File
  47.     {
  48.         return $this->imageFile;
  49.     }
  50.     public function getImageName(): ?string
  51.     {
  52.         return $this->imageName;
  53.     }
  54.     public function setImageName(?string $imageName): self
  55.     {
  56.         $this->imageName $imageName;
  57.         return $this;
  58.     }
  59.     public function getImageUpdatedAt(): ?\DateTimeImmutable
  60.     {
  61.         return $this->image_updatedAt;
  62.     }
  63.     public function setImageUpdatedAt(?\DateTimeImmutable $image_updatedAt): self
  64.     {
  65.         $this->image_updatedAt $image_updatedAt;
  66.         return $this;
  67.     }
  68.     public function getPropertyImage(): ?PropertyList
  69.     {
  70.         return $this->property_image;
  71.     }
  72.     public function setPropertyImage(?PropertyList $property_image): self
  73.     {
  74.         $this->property_image $property_image;
  75.         return $this;
  76.     }
  77.     public function getBedroomImage(): ?Bedroom
  78.     {
  79.         return $this->bedroom_image;
  80.     }
  81.     public function setBedroomImage(?Bedroom $bedroom_image): self
  82.     {
  83.         $this->bedroom_image $bedroom_image;
  84.         return $this;
  85.     }
  86.     public function getOrden(): ?int
  87.     {
  88.         return $this->orden;
  89.     }
  90.     public function setOrden(?int $orden): static
  91.     {
  92.         $this->orden $orden;
  93.         return $this;
  94.     }
  95.     public function getEsImagenHabitacion():bool{
  96.         return $this->esImagenHabitacion ?? false;
  97.     }
  98.     public function setEsImagenHabitacion(?bool $esImagenHabitacion){
  99.         $this->esImagenHabitacion=$esImagenHabitacion ?? false;
  100.     }
  101.     
  102. }