<?php
namespace App\Entity;
use App\Repository\VehiculesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: VehiculesRepository::class)]
class Vehicules
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column()]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $code = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $description = null;
#[ORM\Column(nullable: true)]
private ?int $prix = null;
#[ORM\Column]
private ?bool $isNoprice = null;
#[ORM\Column(length: 255)]
private ?string $photoImage = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $pubDate = null;
#[ORM\Column]
private ?int $status = null;
#[ORM\Column(length: 255)]
private ?string $typeoperation = null;
#[ORM\ManyToOne(inversedBy: 'vehicules')]
private ?User $vendeur = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Marques $marque = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Modeles $modele = null;
#[ORM\Column(length: 255)]
private ?string $etat = null;
#[ORM\ManyToOne(inversedBy: 'vehicules')]
#[ORM\JoinColumn(nullable: false)]
private ?Villes $ville = null;
#[ORM\Column(length: 255)]
private ?string $libelle = null;
#[ORM\OneToMany(mappedBy: 'vehicule', targetEntity: VehiculeVariable::class)]
private Collection $vehiculeVariables;
#[ORM\OneToMany(mappedBy: 'vehicule', targetEntity: Images::class)]
private Collection $imagesVh;
public function __construct()
{
$this->vehiculeVariables = new ArrayCollection();
$this->imagesVh = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
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 getPhotoImage(): ?string
{
return $this->photoImage;
}
public function setPhotoImage(string $photoImage): self
{
$this->photoImage = $photoImage;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getPubDate(): ?\DateTimeInterface
{
return $this->pubDate;
}
public function setPubDate(?\DateTimeInterface $pubDate): self
{
$this->pubDate = $pubDate;
return $this;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
$this->status = $status;
return $this;
}
public function getTypeoperation(): ?string
{
return $this->typeoperation;
}
public function setTypeoperation(string $typeoperation): self
{
$this->typeoperation = $typeoperation;
return $this;
}
public function getVendeur(): ?User
{
return $this->vendeur;
}
public function setVendeur(?User $vendeur): self
{
$this->vendeur = $vendeur;
return $this;
}
public function getMarque(): ?Marques
{
return $this->marque;
}
public function setMarque(?Marques $marque): self
{
$this->marque = $marque;
return $this;
}
public function getModele(): ?Modeles
{
return $this->modele;
}
public function setModele(?Modeles $modele): self
{
$this->modele = $modele;
return $this;
}
public function getEtat(): ?string
{
return $this->etat;
}
public function setEtat(string $etat): self
{
$this->etat = $etat;
return $this;
}
public function getVille(): ?Villes
{
return $this->ville;
}
public function setVille(?Villes $ville): self
{
$this->ville = $ville;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return Collection<int, VehiculeVariable>
*/
public function getVehiculeVariables(): Collection
{
return $this->vehiculeVariables;
}
public function addVehiculeVariable(VehiculeVariable $vehiculeVariable): self
{
if (!$this->vehiculeVariables->contains($vehiculeVariable)) {
$this->vehiculeVariables[] = $vehiculeVariable;
$vehiculeVariable->setVehicule($this);
}
return $this;
}
public function removeVehiculeVariable(VehiculeVariable $vehiculeVariable): self
{
if ($this->vehiculeVariables->removeElement($vehiculeVariable)) {
// set the owning side to null (unless already changed)
if ($vehiculeVariable->getVehicule() === $this) {
$vehiculeVariable->setVehicule(null);
}
}
return $this;
}
/**
* @return Collection<int, Images>
*/
public function getImagesVh(): Collection
{
return $this->imagesVh;
}
public function addImagesVh(Images $imagesVh): self
{
if (!$this->imagesVh->contains($imagesVh)) {
$this->imagesVh[] = $imagesVh;
$imagesVh->setVehicule($this);
}
return $this;
}
public function removeImagesVh(Images $imagesVh): self
{
if ($this->imagesVh->removeElement($imagesVh)) {
// set the owning side to null (unless already changed)
if ($imagesVh->getVehicule() === $this) {
$imagesVh->setVehicule(null);
}
}
return $this;
}
}