src/Entity/OffreImmobiliere.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OffreImmobiliereRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassOffreImmobiliereRepository::class)]
  7. class OffreImmobiliere
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'string'length255nullabletrue)]
  14.     private $titre;
  15.     #[ORM\Column(type'text'nullabletrue)]
  16.     private $description;
  17.     #[ORM\ManyToOne(targetEntityVille::class, inversedBy'offreImmobilieres')]
  18.     private $ville;
  19.     #[ORM\Column(type'datetime')]
  20.     private $created_at;
  21.     #[ORM\Column(type'datetime')]
  22.     private $updated_at;
  23.     public function __construct()
  24.     {
  25.         $this->created_at = new DateTime('now');
  26.         $this->updated_at = new DateTime('now');
  27.     }
  28.     
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getTitre(): ?string
  34.     {
  35.         return $this->titre;
  36.     }
  37.     public function setTitre(?string $titre): self
  38.     {
  39.         $this->titre $titre;
  40.         return $this;
  41.     }
  42.     public function getDescription(): ?string
  43.     {
  44.         return $this->description;
  45.     }
  46.     public function setDescription(?string $description): self
  47.     {
  48.         $this->description $description;
  49.         return $this;
  50.     }
  51.     public function getVille(): ?Ville
  52.     {
  53.         return $this->ville;
  54.     }
  55.     public function setVille(?Ville $ville): self
  56.     {
  57.         $this->ville $ville;
  58.         return $this;
  59.     }
  60.     public function getCreatedAt(): ?\DateTimeInterface
  61.     {
  62.         return $this->created_at;
  63.     }
  64.     public function setCreatedAt(\DateTimeInterface $created_at): self
  65.     {
  66.         $this->created_at $created_at;
  67.         return $this;
  68.     }
  69.     public function getUpdatedAt(): ?\DateTimeInterface
  70.     {
  71.         return $this->updated_at;
  72.     }
  73.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  74.     {
  75.         $this->updated_at $updated_at;
  76.         return $this;
  77.     }
  78. }