<?phpnamespace App\Entity;use App\Repository\BrandRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=BrandRepository::class) */class Brand{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=100) */ private $label; /** * @ORM\Column(type="boolean") */ private $is_active; /** * @ORM\OneToMany(targetEntity=Article::class, mappedBy="brand", orphanRemoval=true) */ private $articles; public function __construct() { $this->articles = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): self { $this->label = $label; return $this; } public function isIsActive(): ?bool { return $this->is_active; } public function setIsActive(bool $is_active): self { $this->is_active = $is_active; return $this; } /** * @return Collection<int, Article> */ public function getArticles(): Collection { return $this->articles; } public function addArticle(Article $article): self { if (!$this->articles->contains($article)) { $this->articles[] = $article; $article->setBrand($this); } return $this; } public function removeArticle(Article $article): self { if ($this->articles->removeElement($article)) { // set the owning side to null (unless already changed) if ($article->getBrand() === $this) { $article->setBrand(null); } } return $this; }}