src/Entity/SousCategory.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SousCategoryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=SousCategoryRepository::class)
  7.  */
  8. class SousCategory
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=255)
  18.      */
  19.     private $title;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $NomRecherche;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="SousCategory")
  26.      * @ORM\JoinColumn(nullable=false)
  27.      */
  28.     private $category;
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getTitle(): ?string
  34.     {
  35.         return $this->title;
  36.     }
  37.     public function setTitle(string $title): self
  38.     {
  39.         $this->title $title;
  40.         return $this;
  41.     }
  42.     public function getNomRecherche(): ?string
  43.     {
  44.         return $this->NomRecherche;
  45.     }
  46.     public function setNomRecherche(string $NomRecherche): self
  47.     {
  48.         $this->NomRecherche $NomRecherche;
  49.         return $this;
  50.     }
  51.     public function getCategory(): ?Category
  52.     {
  53.         return $this->category;
  54.     }
  55.     public function setCategory(?Category $category): self
  56.     {
  57.         $this->category $category;
  58.         return $this;
  59.     }
  60.     public function to_arraytabSousCat(): Array
  61.     {
  62.         $tmp = [
  63.             'id' => $this->id,
  64.             'title' => $this->title,
  65.             'category' => $this->category,
  66.         ];
  67.         return $tmp;
  68.     }
  69. }