<?php
namespace App\Entity;
use App\Repository\AnnoncesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AnnoncesRepository::class)
*/
class Annonces
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $Titre;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $Prix;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $Description;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $PourcentRemise;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $DateDebut;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $DateFin;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $Quantite;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $VisiblePro = 0;
/**
* @ORM\ManyToOne(targetEntity=Categories::class, inversedBy="annonces")
*/
private $Categories;
/**
* @ORM\OneToMany(targetEntity=Images::class, mappedBy="Annonces", cascade={"persist", "remove"})
*/
private $images;
/**
* @ORM\OneToMany(targetEntity=Favoris::class, mappedBy="Annonces")
*/
private $favoris;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="annonces")
*/
private $User;
/**
* @ORM\OneToMany(targetEntity=NotesAnnonces::class, mappedBy="Annonces")
*/
private $notesAnnonces;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $Booster;
/**
* @ORM\ManyToOne(targetEntity=Villes::class, inversedBy="annonces")
*/
private $Villes;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $NbVues;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $Image;
public function __construct()
{
$this->images = new ArrayCollection();
$this->favoris = new ArrayCollection();
$this->notesAnnonces = new ArrayCollection();
}
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 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 getPourcentRemise(): ?float
{
return $this->PourcentRemise;
}
public function setPourcentRemise(?float $PourcentRemise): self
{
$this->PourcentRemise = $PourcentRemise;
return $this;
}
public function getDateDebut(): ?\DateTimeInterface
{
return $this->DateDebut;
}
public function setDateDebut(?\DateTimeInterface $DateDebut): self
{
$this->DateDebut = $DateDebut;
return $this;
}
public function getDateFin(): ?\DateTimeInterface
{
return $this->DateFin;
}
public function setDateFin(?\DateTimeInterface $DateFin): self
{
$this->DateFin = $DateFin;
return $this;
}
public function getQuantite(): ?int
{
return $this->Quantite;
}
public function setQuantite(?int $Quantite): self
{
$this->Quantite = $Quantite;
return $this;
}
public function isVisiblePro(): ?bool
{
return $this->VisiblePro;
}
public function setVisiblePro(?bool $VisiblePro): self
{
$this->VisiblePro = $VisiblePro;
return $this;
}
public function getCategories(): ?Categories
{
return $this->Categories;
}
public function setCategories(?Categories $Categories): self
{
$this->Categories = $Categories;
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->setAnnonces($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->getAnnonces() === $this) {
$image->setAnnonces(null);
}
}
return $this;
}
/**
* @return Collection<int, Favoris>
*/
public function getFavoris(): Collection
{
return $this->favoris;
}
public function addFavori(Favoris $favori): self
{
if (!$this->favoris->contains($favori)) {
$this->favoris[] = $favori;
$favori->setAnnonces($this);
}
return $this;
}
public function removeFavori(Favoris $favori): self
{
if ($this->favoris->removeElement($favori)) {
// set the owning side to null (unless already changed)
if ($favori->getAnnonces() === $this) {
$favori->setAnnonces(null);
}
}
return $this;
}
public function getUser(): ?User
{
return $this->User;
}
public function setUser(?User $User): self
{
$this->User = $User;
return $this;
}
/**
* @return Collection<int, NotesAnnonces>
*/
public function getNotesAnnonces(): Collection
{
return $this->notesAnnonces;
}
public function addNotesAnnonce(NotesAnnonces $notesAnnonce): self
{
if (!$this->notesAnnonces->contains($notesAnnonce)) {
$this->notesAnnonces[] = $notesAnnonce;
$notesAnnonce->setAnnonces($this);
}
return $this;
}
public function removeNotesAnnonce(NotesAnnonces $notesAnnonce): self
{
if ($this->notesAnnonces->removeElement($notesAnnonce)) {
// set the owning side to null (unless already changed)
if ($notesAnnonce->getAnnonces() === $this) {
$notesAnnonce->setAnnonces(null);
}
}
return $this;
}
public function isBooster(): ?bool
{
return $this->Booster;
}
public function setBooster(?bool $Booster): self
{
$this->Booster = $Booster;
return $this;
}
public function getVilles(): ?Villes
{
return $this->Villes;
}
public function setVilles(?Villes $Villes): self
{
$this->Villes = $Villes;
return $this;
}
public function getNbVues(): ?int
{
return $this->NbVues;
}
public function setNbVues(?int $NbVues): self
{
$this->NbVues = $NbVues;
return $this;
}
public function getImage(): ?string
{
return $this->Image;
}
public function setImage(?string $Image): self
{
$this->Image = $Image;
return $this;
}
}