<?php
namespace App\Entity;
use App\Repository\MarquesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: MarquesRepository::class)]
class Marques
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column()]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $libelle = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\Column(length: 20)]
private ?string $code = null;
#[ORM\Column]
private ?bool $isActif = null;
#[ORM\Column(length: 255)]
private ?string $slug = null;
#[ORM\OneToMany(mappedBy: 'marque', targetEntity: Modeles::class)]
private Collection $modeles;
public function __construct()
{
$this->modeles = new ArrayCollection();
}
public function getId(): ?int
{
return $this->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 getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function isIsActif(): ?bool
{
return $this->isActif;
}
public function setIsActif(bool $isActif): self
{
$this->isActif = $isActif;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, Modeles>
*/
public function getModeles(): Collection
{
return $this->modeles;
}
public function addModele(Modeles $modele): self
{
if (!$this->modeles->contains($modele)) {
$this->modeles[] = $modele;
$modele->setMarque($this);
}
return $this;
}
public function removeModele(Modeles $modele): self
{
if ($this->modeles->removeElement($modele)) {
// set the owning side to null (unless already changed)
if ($modele->getMarque() === $this) {
$modele->setMarque(null);
}
}
return $this;
}
}