<?php
namespace App\Entity;
use App\Repository\OffreImmobiliereRepository;
use DateTime;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OffreImmobiliereRepository::class)]
class OffreImmobiliere
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $titre;
#[ORM\Column(type: 'text', nullable: true)]
private $description;
#[ORM\ManyToOne(targetEntity: Ville::class, inversedBy: 'offreImmobilieres')]
private $ville;
#[ORM\Column(type: 'datetime')]
private $created_at;
#[ORM\Column(type: 'datetime')]
private $updated_at;
public function __construct()
{
$this->created_at = new DateTime('now');
$this->updated_at = new DateTime('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getVille(): ?Ville
{
return $this->ville;
}
public function setVille(?Ville $ville): self
{
$this->ville = $ville;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
}