src/Entity/Marques.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MarquesRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassMarquesRepository::class)]
  8. class Marques
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column()]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $libelle null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $description null;
  18.     #[ORM\Column(length20)]
  19.     private ?string $code null;
  20.     #[ORM\Column]
  21.     private ?bool $isActif null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $slug null;
  24.     #[ORM\OneToMany(mappedBy'marque'targetEntityModeles::class)]
  25.     private Collection $modeles;
  26.     public function __construct()
  27.     {
  28.         $this->modeles = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getLibelle(): ?string
  35.     {
  36.         return $this->libelle;
  37.     }
  38.     public function setLibelle(string $libelle): self
  39.     {
  40.         $this->libelle $libelle;
  41.         return $this;
  42.     }
  43.     public function getDescription(): ?string
  44.     {
  45.         return $this->description;
  46.     }
  47.     public function setDescription(?string $description): self
  48.     {
  49.         $this->description $description;
  50.         return $this;
  51.     }
  52.     public function getCode(): ?string
  53.     {
  54.         return $this->code;
  55.     }
  56.     public function setCode(string $code): self
  57.     {
  58.         $this->code $code;
  59.         return $this;
  60.     }
  61.     public function isIsActif(): ?bool
  62.     {
  63.         return $this->isActif;
  64.     }
  65.     public function setIsActif(bool $isActif): self
  66.     {
  67.         $this->isActif $isActif;
  68.         return $this;
  69.     }
  70.     public function getSlug(): ?string
  71.     {
  72.         return $this->slug;
  73.     }
  74.     public function setSlug(string $slug): self
  75.     {
  76.         $this->slug $slug;
  77.         return $this;
  78.     }
  79.     /**
  80.      * @return Collection<int, Modeles>
  81.      */
  82.     public function getModeles(): Collection
  83.     {
  84.         return $this->modeles;
  85.     }
  86.     public function addModele(Modeles $modele): self
  87.     {
  88.         if (!$this->modeles->contains($modele)) {
  89.             $this->modeles[] = $modele;
  90.             $modele->setMarque($this);
  91.         }
  92.         return $this;
  93.     }
  94.     public function removeModele(Modeles $modele): self
  95.     {
  96.         if ($this->modeles->removeElement($modele)) {
  97.             // set the owning side to null (unless already changed)
  98.             if ($modele->getMarque() === $this) {
  99.                 $modele->setMarque(null);
  100.             }
  101.         }
  102.         return $this;
  103.     }
  104. }