src/Entity/BuildingDocument.php line 17
<?php
namespace App\Entity;
use App\Repository\BuildingDocumentRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints\DateTime;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: BuildingDocumentRepository::class)]
#[Vich\Uploadable]
class BuildingDocument
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[Vich\UploadableField(mapping: "building_file", fileNameProperty: "imageFile")]
private ?File $picture = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $createdAt = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $uploadedAt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $imageFile = null;
#[ORM\ManyToOne(inversedBy: 'buildingDocuments')]
private ?Building $building = null;
#[ORM\ManyToOne(inversedBy: 'buildingDocuments')]
private ?Residence $residence = null;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris'));
$this->uploadedAt = new \DateTime('now', new \DateTimeZone('Europe/Paris'));
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUploadedAt(): ?\DateTimeInterface
{
return $this->uploadedAt;
}
public function setUploadedAt(?\DateTimeInterface $uploadedAt): self
{
$this->uploadedAt = $uploadedAt;
return $this;
}
public function getImageFile(): ?string
{
return $this->imageFile;
}
public function setImageFile(?string $imageFile): self
{
$this->imageFile = $imageFile;
return $this;
}
public function getBuilding(): ?Building
{
return $this->building;
}
public function setBuilding(?Building $building): self
{
$this->building = $building;
return $this;
}
/**
* @return File|null
*/
public function getPicture(): ?File
{
return $this->picture;
}
/**
* @param File|null $picture
*/
public function setPicture(?File $picture): self
{
$this->picture = $picture;
return $this;
}
public function getResidence(): ?Residence
{
return $this->residence;
}
public function setResidence(?Residence $residence): self
{
$this->residence = $residence;
return $this;
}
}