<?php
namespace App\Entity;
use App\Repository\ClassementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ClassementRepository::class)
*/
class Classement
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $designation;
/**
* @ORM\OneToMany(targetEntity=SupCategorie::class, mappedBy="classement")
*/
private $supCategories;
public function __construct()
{
$this->supCategories = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(string $designation): self
{
$this->designation = $designation;
return $this;
}
/**
* @return Collection<int, SupCategorie>
*/
public function getSupCategories(): Collection
{
return $this->supCategories;
}
public function addSupCategory(SupCategorie $supCategory): self
{
if (!$this->supCategories->contains($supCategory)) {
$this->supCategories[] = $supCategory;
$supCategory->setClassement($this);
}
return $this;
}
public function removeSupCategory(SupCategorie $supCategory): self
{
if ($this->supCategories->removeElement($supCategory)) {
// set the owning side to null (unless already changed)
if ($supCategory->getClassement() === $this) {
$supCategory->setClassement(null);
}
}
return $this;
}
}