<?php
namespace App\Entity;
use App\Repository\ImageRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: ImageRepository::class)]
#[Vich\Uploadable]
class Image
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $imageName = null;
#[Vich\UploadableField(mapping: 'property_images', fileNameProperty: 'imageName')]
private ?File $imageFile = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $image_updatedAt = null;
#[ORM\ManyToOne(inversedBy: 'images')]
private ?PropertyList $property_image = null;
#[ORM\ManyToOne(inversedBy: 'images')]
private ?Bedroom $bedroom_image = null;
#[ORM\Column(nullable: true)]
#[ORM\OrderBy(["orden"=>"ASC"])]
private ?int $orden = null;
private $esImagenHabitacion=null;
public function getId(): ?int
{
return $this->id;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setImageFile(?File $imageFile = null): void
{
$this->imageFile = $imageFile;
if (null !== $imageFile) {
$this->image_updatedAt = new \DateTimeImmutable();
}
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
public function getImageName(): ?string
{
return $this->imageName;
}
public function setImageName(?string $imageName): self
{
$this->imageName = $imageName;
return $this;
}
public function getImageUpdatedAt(): ?\DateTimeImmutable
{
return $this->image_updatedAt;
}
public function setImageUpdatedAt(?\DateTimeImmutable $image_updatedAt): self
{
$this->image_updatedAt = $image_updatedAt;
return $this;
}
public function getPropertyImage(): ?PropertyList
{
return $this->property_image;
}
public function setPropertyImage(?PropertyList $property_image): self
{
$this->property_image = $property_image;
return $this;
}
public function getBedroomImage(): ?Bedroom
{
return $this->bedroom_image;
}
public function setBedroomImage(?Bedroom $bedroom_image): self
{
$this->bedroom_image = $bedroom_image;
return $this;
}
public function getOrden(): ?int
{
return $this->orden;
}
public function setOrden(?int $orden): static
{
$this->orden = $orden;
return $this;
}
public function getEsImagenHabitacion():bool{
return $this->esImagenHabitacion ?? false;
}
public function setEsImagenHabitacion(?bool $esImagenHabitacion){
$this->esImagenHabitacion=$esImagenHabitacion ?? false;
}
}