<?php
namespace App\Entity;
use App\Repository\AnnoncesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AnnoncesRepository::class)]
class Annonces
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'annonces')]
private ?User $user = null;
#[ORM\Column(nullable: true)]
private ?float $superficie = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adresse = null;
#[ORM\Column(nullable: true)]
private ?float $prix = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $titre = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $longitude = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $latitude = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $codepostale = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $slug = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private $updated_at;
#[ORM\Column(type: 'datetime', nullable: true)]
private $created_at;
#[ORM\Column(length: 255, nullable: true)]
private ?string $dpe = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ges = null;
#[ORM\Column(nullable: true)]
private ?float $honoraires = null;
#[ORM\ManyToOne]
private ?VillesFrance $villes_france = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ville_slug = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ville_code_postal = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $piece = null;
#[ORM\OneToMany(mappedBy: 'annonce', targetEntity: Images::class)]
private Collection $images;
#[ORM\OneToMany(mappedBy: 'annonce', targetEntity: Messages::class)]
private Collection $messages;
#[ORM\OneToMany(mappedBy: 'annonce', targetEntity: Visiteurs::class)]
private Collection $visiteurs;
#[ORM\OneToMany(mappedBy: 'annonce', targetEntity: Event::class)]
private Collection $events;
#[ORM\OneToMany(mappedBy: 'annonce', targetEntity: Reservations::class)]
private Collection $reservations;
#[ORM\ManyToOne(inversedBy: 'annonces')]
private ?Agences $agence = null;
#[ORM\ManyToMany(targetEntity: Equipements::class, inversedBy: 'annonces')]
private Collection $equipements;
#[ORM\OneToMany(mappedBy: 'logement', targetEntity: CommentairesLogements::class)]
private Collection $commentairesLogements;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ville = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $codepostal = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $transaction = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $etat = null;
#[ORM\ManyToOne(inversedBy: 'annonces')]
private ?VillesFrance $ville_annonce = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $logement = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $chauffage = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $pieces = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $chambres = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $charges = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $quantite = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $chambre = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $salledebain = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $garage = null;
#[ORM\OneToMany(mappedBy: 'annonce', targetEntity: PostLike::class)]
private Collection $postLikes;
#[ORM\Column(length: 255, nullable: true)]
private ?string $psedo = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $domaine = null;
#[ORM\ManyToOne(inversedBy: 'annonces')]
private ?Hotels $hotel = null;
public function __construct()
{
$this->images = new ArrayCollection();
$this->messages = new ArrayCollection();
$this->visiteurs = new ArrayCollection();
$this->events = new ArrayCollection();
$this->reservations = new ArrayCollection();
$this->equipements = new ArrayCollection();
$this->commentairesLogements = new ArrayCollection();
$this->created_at = new \DateTime();
$this->postLikes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getSuperficie(): ?float
{
return $this->superficie;
}
public function setSuperficie(?float $superficie): self
{
$this->superficie = $superficie;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getPrix(): ?float
{
return $this->prix;
}
public function setPrix(?float $prix): self
{
$this->prix = $prix;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getLongitude(): ?string
{
return $this->longitude;
}
public function setLongitude(?string $longitude): self
{
$this->longitude = $longitude;
return $this;
}
public function getLatitude(): ?string
{
return $this->latitude;
}
public function setLatitude(?string $latitude): self
{
$this->latitude = $latitude;
return $this;
}
public function getCodepostale(): ?string
{
return $this->codepostale;
}
public function setCodepostale(?string $codepostale): self
{
$this->codepostale = $codepostale;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(?\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
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 getDpe(): ?string
{
return $this->dpe;
}
public function setDpe(?string $dpe): self
{
$this->dpe = $dpe;
return $this;
}
public function getGes(): ?string
{
return $this->ges;
}
public function setGes(?string $ges): self
{
$this->ges = $ges;
return $this;
}
public function getHonoraires(): ?float
{
return $this->honoraires;
}
public function setHonoraires(?float $honoraires): self
{
$this->honoraires = $honoraires;
return $this;
}
public function getVillesFrance(): ?VillesFrance
{
return $this->villes_france;
}
public function setVillesFrance(?VillesFrance $villes_france): self
{
$this->villes_france = $villes_france;
return $this;
}
public function getVilleSlug(): ?string
{
return $this->ville_slug;
}
public function setVilleSlug(?string $ville_slug): self
{
$this->ville_slug = $ville_slug;
return $this;
}
public function getVilleCodePostal(): ?string
{
return $this->ville_code_postal;
}
public function setVilleCodePostal(?string $ville_code_postal): self
{
$this->ville_code_postal = $ville_code_postal;
return $this;
}
public function getPiece(): ?string
{
return $this->piece;
}
public function setPiece(?string $piece): self
{
$this->piece = $piece;
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->add($image);
$image->setAnnonce($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->getAnnonce() === $this) {
$image->setAnnonce(null);
}
}
return $this;
}
/**
* @return Collection<int, Messages>
*/
public function getMessages(): Collection
{
return $this->messages;
}
public function addMessage(Messages $message): self
{
if (!$this->messages->contains($message)) {
$this->messages->add($message);
$message->setAnnonce($this);
}
return $this;
}
public function removeMessage(Messages $message): self
{
if ($this->messages->removeElement($message)) {
// set the owning side to null (unless already changed)
if ($message->getAnnonce() === $this) {
$message->setAnnonce(null);
}
}
return $this;
}
/**
* @return Collection<int, Visiteurs>
*/
public function getVisiteurs(): Collection
{
return $this->visiteurs;
}
public function addVisiteur(Visiteurs $visiteur): self
{
if (!$this->visiteurs->contains($visiteur)) {
$this->visiteurs->add($visiteur);
$visiteur->setAnnonce($this);
}
return $this;
}
public function removeVisiteur(Visiteurs $visiteur): self
{
if ($this->visiteurs->removeElement($visiteur)) {
// set the owning side to null (unless already changed)
if ($visiteur->getAnnonce() === $this) {
$visiteur->setAnnonce(null);
}
}
return $this;
}
/**
* @return Collection<int, Event>
*/
public function getEvents(): Collection
{
return $this->events;
}
public function addEvent(Event $event): self
{
if (!$this->events->contains($event)) {
$this->events->add($event);
$event->setAnnonce($this);
}
return $this;
}
public function removeEvent(Event $event): self
{
if ($this->events->removeElement($event)) {
// set the owning side to null (unless already changed)
if ($event->getAnnonce() === $this) {
$event->setAnnonce(null);
}
}
return $this;
}
/**
* @return Collection<int, Reservations>
*/
public function getReservations(): Collection
{
return $this->reservations;
}
public function addReservation(Reservations $reservation): self
{
if (!$this->reservations->contains($reservation)) {
$this->reservations->add($reservation);
$reservation->setAnnonce($this);
}
return $this;
}
public function removeReservation(Reservations $reservation): self
{
if ($this->reservations->removeElement($reservation)) {
// set the owning side to null (unless already changed)
if ($reservation->getAnnonce() === $this) {
$reservation->setAnnonce(null);
}
}
return $this;
}
public function getAgence(): ?Agences
{
return $this->agence;
}
public function setAgence(?Agences $agence): self
{
$this->agence = $agence;
return $this;
}
/**
* @return Collection<int, Equipements>
*/
public function getEquipements(): Collection
{
return $this->equipements;
}
public function addEquipement(Equipements $equipement): self
{
if (!$this->equipements->contains($equipement)) {
$this->equipements->add($equipement);
}
return $this;
}
public function removeEquipement(Equipements $equipement): self
{
$this->equipements->removeElement($equipement);
return $this;
}
/**
* @return Collection<int, CommentairesLogements>
*/
public function getCommentairesLogements(): Collection
{
return $this->commentairesLogements;
}
public function addCommentairesLogement(CommentairesLogements $commentairesLogement): self
{
if (!$this->commentairesLogements->contains($commentairesLogement)) {
$this->commentairesLogements->add($commentairesLogement);
$commentairesLogement->setLogement($this);
}
return $this;
}
public function removeCommentairesLogement(CommentairesLogements $commentairesLogement): self
{
if ($this->commentairesLogements->removeElement($commentairesLogement)) {
// set the owning side to null (unless already changed)
if ($commentairesLogement->getLogement() === $this) {
$commentairesLogement->setLogement(null);
}
}
return $this;
}
public function getVille(): ?string
{
return $this->ville;
}
public function setVille(?string $ville): self
{
$this->ville = $ville;
return $this;
}
public function getCodepostal(): ?string
{
return $this->codepostal;
}
public function setCodepostal(?string $codepostal): self
{
$this->codepostal = $codepostal;
return $this;
}
public function getTransaction(): ?string
{
return $this->transaction;
}
public function setTransaction(?string $transaction): self
{
$this->transaction = $transaction;
return $this;
}
public function getEtat(): ?string
{
return $this->etat;
}
public function setEtat(?string $etat): self
{
$this->etat = $etat;
return $this;
}
public function getVilleAnnonce(): ?VillesFrance
{
return $this->ville_annonce;
}
public function setVilleAnnonce(?VillesFrance $ville_annonce): self
{
$this->ville_annonce = $ville_annonce;
return $this;
}
public function getLogement(): ?string
{
return $this->logement;
}
public function setLogement(?string $logement): self
{
$this->logement = $logement;
return $this;
}
public function getChauffage(): ?string
{
return $this->chauffage;
}
public function setChauffage(?string $chauffage): self
{
$this->chauffage = $chauffage;
return $this;
}
public function getPieces(): ?string
{
return $this->pieces;
}
public function setPieces(?string $pieces): self
{
$this->pieces = $pieces;
return $this;
}
public function getChambres(): ?string
{
return $this->chambres;
}
public function setChambres(?string $chambres): self
{
$this->chambres = $chambres;
return $this;
}
public function getCharges(): ?string
{
return $this->charges;
}
public function setCharges(?string $charges): self
{
$this->charges = $charges;
return $this;
}
public function getQuantite(): ?string
{
return $this->quantite;
}
public function setQuantite(?string $quantite): self
{
$this->quantite = $quantite;
return $this;
}
public function getChambre(): ?string
{
return $this->chambre;
}
public function setChambre(?string $chambre): self
{
$this->chambre = $chambre;
return $this;
}
public function getSalledebain(): ?string
{
return $this->salledebain;
}
public function setSalledebain(?string $salledebain): self
{
$this->salledebain = $salledebain;
return $this;
}
public function getGarage(): ?string
{
return $this->garage;
}
public function setGarage(?string $garage): self
{
$this->garage = $garage;
return $this;
}
/**
* @return Collection<int, PostLike>
*/
public function getPostLikes(): Collection
{
return $this->postLikes;
}
public function addPostLike(PostLike $postLike): self
{
if (!$this->postLikes->contains($postLike)) {
$this->postLikes->add($postLike);
$postLike->setAnnonce($this);
}
return $this;
}
public function removePostLike(PostLike $postLike): self
{
if ($this->postLikes->removeElement($postLike)) {
// set the owning side to null (unless already changed)
if ($postLike->getAnnonce() === $this) {
$postLike->setAnnonce(null);
}
}
return $this;
}
public function getPsedo(): ?string
{
return $this->psedo;
}
public function setPsedo(?string $psedo): self
{
$this->psedo = $psedo;
return $this;
}
public function getDomaine(): ?string
{
return $this->domaine;
}
public function setDomaine(?string $domaine): self
{
$this->domaine = $domaine;
return $this;
}
public function getHotel(): ?Hotels
{
return $this->hotel;
}
public function setHotel(?Hotels $hotel): self
{
$this->hotel = $hotel;
return $this;
}
}