src/Entity/EventLevel.php line 13
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\EventLevelRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: EventLevelRepository::class)]#[ApiResource]class EventLevel{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 50)]private ?string $name = null;#[ORM\OneToMany(mappedBy: 'eventLevel', targetEntity: Event::class, orphanRemoval: true)]private Collection $events;public function __construct(){$this->events = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}/*** @return Collection<int, Event>*/public function getEvents(): Collection{return $this->events;}public function addEvent(Event $event): self{if (!$this->events->contains($event)) {$this->events->add($event);$event->setEventLevel($this);}return $this;}public function removeEvent(Event $event): self{if ($this->events->removeElement($event)) {// set the owning side to null (unless already changed)if ($event->getEventLevel() === $this) {$event->setEventLevel(null);}}return $this;}}