<?php
namespace App\Entity;
use App\Repository\ImmeublesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ImmeublesRepository::class)]
class Immeubles
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column()]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $libelle = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $description = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[ORM\Column(length: 20)]
private ?string $code = null;
#[ORM\Column(length: 15)]
private ?string $typeoperation = null;
#[ORM\Column]
private ?int $status = null;
#[ORM\Column]
private ?int $prix = null;
#[ORM\Column]
private ?bool $isNoprice = null;
#[ORM\ManyToOne(inversedBy: 'immeubles')]
#[ORM\JoinColumn(nullable: false)]
private ?User $vendeur = null;
#[ORM\OneToMany(mappedBy: 'immeuble', targetEntity: ImmeubleVariable::class)]
private Collection $immeubleVariables;
#[ORM\Column(length: 255)]
private ?string $photo = null;
#[ORM\ManyToOne(inversedBy: 'immeubles')]
#[ORM\JoinColumn(nullable: false)]
private ?Villes $ville = null;
#[ORM\ManyToOne(inversedBy: 'immeubles')]
#[ORM\JoinColumn(nullable: true)]
private ?Quartiers $quartier = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $pubDate = null;
#[ORM\ManyToOne(inversedBy: 'immeubles')]
#[ORM\JoinColumn(nullable: false)]
private ?Categories $categorie = null;
#[ORM\OneToMany(mappedBy: 'immeuble', targetEntity: Images::class)]
private Collection $images;
public function __construct()
{
$this->immeubleVariables = new ArrayCollection();
$this->images = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getTypeoperation(): ?string
{
return $this->typeoperation;
}
public function setTypeoperation(string $typeoperation): self
{
$this->typeoperation = $typeoperation;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getPrix(): ?int
{
return $this->prix;
}
public function setPrix(int $prix): self
{
$this->prix = $prix;
return $this;
}
public function isIsNoprice(): ?bool
{
return $this->isNoprice;
}
public function setIsNoprice(bool $isNoprice): self
{
$this->isNoprice = $isNoprice;
return $this;
}
public function getVendeur(): ?User
{
return $this->vendeur;
}
public function setVendeur(?User $vendeur): self
{
$this->vendeur = $vendeur;
return $this;
}
/**
* @return Collection<int, ImmeubleVariable>
*/
public function getImmeubleVariables(): Collection
{
return $this->immeubleVariables;
}
public function addImmeubleVariable(ImmeubleVariable $immeubleVariable): self
{
if (!$this->immeubleVariables->contains($immeubleVariable)) {
$this->immeubleVariables[] = $immeubleVariable;
$immeubleVariable->setImmeuble($this);
}
return $this;
}
public function removeImmeubleVariable(ImmeubleVariable $immeubleVariable): self
{
if ($this->immeubleVariables->removeElement($immeubleVariable)) {
// set the owning side to null (unless already changed)
if ($immeubleVariable->getImmeuble() === $this) {
$immeubleVariable->setImmeuble(null);
}
}
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(string $photo): self
{
$this->photo = $photo;
return $this;
}
public function getVille(): ?Villes
{
return $this->ville;
}
public function setVille(?Villes $ville): self
{
$this->ville = $ville;
return $this;
}
public function getQuartier(): ?Quartiers
{
return $this->quartier;
}
public function setQuartier(?Quartiers $quartier): self
{
$this->quartier = $quartier;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getPubDate(): ?\DateTimeImmutable
{
return $this->pubDate;
}
public function setPubDate(?\DateTimeImmutable $pubDate): self
{
$this->pubDate = $pubDate;
return $this;
}
public function getCategorie(): ?Categories
{
return $this->categorie;
}
public function setCategorie(?Categories $categorie): self
{
$this->categorie = $categorie;
return $this;
}
/**
* @return Collection<int, Images>
*/
public function getImages(): Collection
{
return $this->images;
}
public function addImage(Images $image): self
{
if (!$this->images->contains($image)) {
$this->images[] = $image;
$image->setImmeuble($this);
}
return $this;
}
public function removeImage(Images $image): self
{
if ($this->images->removeElement($image)) {
// set the owning side to null (unless already changed)
if ($image->getImmeuble() === $this) {
$image->setImmeuble(null);
}
}
return $this;
}
}