<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity */class CategoriaEvento{ /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\Column(type="string", nullable=true) */ private $nombre; /** * @ORM\Column(type="string", nullable=true) */ private $alias; /** * @ORM\Column(type="array", nullable=true) */ private $role; /** * @ORM\ManyToMany(targetEntity=\App\Entity\Evento::class, mappedBy="categoriasevento") */ private $eventos; public function __construct() { $this->eventos = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function setId($id) { $this->id = $id; return $this; } public function getNombre(): ?string { return $this->nombre; } public function setNombre(?string $nombre): static { $this->nombre = $nombre; return $this; } public function getAlias(): ?string { return $this->alias; } public function setAlias(?string $alias): static { $this->alias = $alias; return $this; } public function getRole(): ?array { return $this->role; } public function setRole(?array $role): static { $this->role = $role; return $this; } /** * @return Collection<int, Evento> */ public function getEventos(): Collection { return $this->eventos; } public function addEvento(Evento $evento): static { if (!$this->eventos->contains($evento)) { $this->eventos->add($evento); $evento->addCategoriaEvento($this); } return $this; } public function removeEvento(Evento $evento): static { if ($this->eventos->removeElement($evento)) { $evento->removeCategoriaEvento($this); } return $this; }}