<?php
namespace App\Entity;
use App\Repository\SousCategoryRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SousCategoryRepository::class)
*/
class SousCategory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=255)
*/
private $NomRecherche;
/**
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="SousCategory")
* @ORM\JoinColumn(nullable=false)
*/
private $category;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getNomRecherche(): ?string
{
return $this->NomRecherche;
}
public function setNomRecherche(string $NomRecherche): self
{
$this->NomRecherche = $NomRecherche;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
public function to_arraytabSousCat(): Array
{
$tmp = [
'id' => $this->id,
'title' => $this->title,
'category' => $this->category,
];
return $tmp;
}
}