src/Entity/Categorie.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\CategorieRepository;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. //#[ORM\Entity(repositoryClass: CategorieRepository::class)]
  8. #[ORM\Entity]
  9. #[ORM\Table(name"categorie")]
  10. class Categorie
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue(strategy"IDENTITY")]
  14.     #[ORM\Column(name"id"type"integer")]
  15.     private ?int $id null;
  16.     #[ORM\Column(name"nom"type"string"length255)]
  17.     private ?string $nom null;
  18.     #[ORM\Column(name"description"type"string"length500nullabletrue)]
  19.     private ?string $description null;
  20.     #[ORM\Column(name"last_updated"type"date"nullabletrue)]
  21.     private ?\DateTimeInterface $lastUpdated null;
  22.     #[ORM\Column(name"image"type"string"length600nullabletrue)]
  23.     private ?string $image null;
  24.     #[ORM\Column(name"nbSousCategorie"type"integer"nullablefalse options: ["default" => "0"])]
  25.     private ?int $nbsouscategorie 0;
  26.     #[ORM\OneToMany(targetEntity:"App\Entity\Souscategorie"mappedBy:"categorie")]
  27.     private $souscategories;
  28.     public function __construct()
  29.     {
  30.         $this->souscategories = new ArrayCollection();
  31.     }
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getNom(): ?string
  37.     {
  38.         return $this->nom;
  39.     }
  40.     public function setNom(string $nom): static
  41.     {
  42.         $this->nom $nom;
  43.         return $this;
  44.     }
  45.     public function getDescription(): ?string
  46.     {
  47.         return $this->description;
  48.     }
  49.     public function setDescription(?string $description): static
  50.     {
  51.         $this->description $description;
  52.         return $this;
  53.     }
  54.     public function getLastUpdated(): ?\DateTimeInterface
  55.     {
  56.         return $this->lastUpdated;
  57.     }
  58.     public function setLastUpdated(?\DateTimeInterface $lastUpdated): static
  59.     {
  60.         $this->lastUpdated $lastUpdated;
  61.         return $this;
  62.     }
  63.     public function getImage(): ?string
  64.     {
  65.         return $this->image;
  66.     }
  67.     public function setImage(?string $image): static
  68.     {
  69.         $this->image $image;
  70.         return $this;
  71.     }
  72.     public function getNbsouscategorie(): ?int
  73.     {
  74.         return $this->nbsouscategorie;
  75.     }
  76.     public function setNbsouscategorie(?int $nbsouscategorie): static
  77.     {
  78.         $this->nbsouscategorie $nbsouscategorie;
  79.         return $this;
  80.     }
  81.     /**
  82.      * @return Collection|Souscategorie[]
  83.      */
  84.     public function getSouscategories(): Collection
  85.     {
  86.         return $this->souscategories;
  87.     }
  88. }