<?php
namespace App\Entity;
use App\Repository\EventRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=EventRepository::class)
*/
class Event
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"event:list", "event:item","round:list","round:item"})
*/
private $eventTypeCode;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"event:list", "event:item","round:list","round:item"})
*/
private $description;
/**
* @ORM\Column(type="integer")
* @Groups({"event:list", "event:item"})
*/
private $drawSize;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"event:list", "event:item"})
*/
private $numByes;
/**
* @ORM\Column(type="boolean")
* @Groups({"event:list", "event:item"})
*/
private $hasRoundRobin;
/**
* @ORM\Column(type="boolean")
* @Groups({"event:list", "event:item","round:list","round:item"})
*/
private $isTeamEvent;
/**
* @ORM\OneToMany(targetEntity=Breakdown::class, mappedBy="event")
* @Groups({"event:list", "event:item"})
*/
private $breakdowns;
/**
* @ORM\OneToMany(targetEntity=Round::class, mappedBy="event")
* @Groups({"event:list", "event:item"})
*/
private $rounds;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"event:list", "event:item"})
*/
private $roundRobinRound;
public function __construct()
{
$this->rounds = new ArrayCollection();
$this->breakdowns = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getEventTypeCode(): ?string
{
return $this->eventTypeCode;
}
public function setEventTypeCode(?string $eventTypeCode): self
{
$this->eventTypeCode = $eventTypeCode;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDrawSize(): ?int
{
return $this->drawSize;
}
public function setDrawSize(int $drawSize): self
{
$this->drawSize = $drawSize;
return $this;
}
public function getNumByes(): ?int
{
return $this->numByes;
}
public function setNumByes(?int $numByes): self
{
$this->numByes = $numByes;
return $this;
}
public function isHasRoundRobin(): ?bool
{
return $this->hasRoundRobin;
}
public function setHasRoundRobin(bool $hasRoundRobin): self
{
$this->hasRoundRobin = $hasRoundRobin;
return $this;
}
public function isIsTeamEvent(): ?bool
{
return $this->isTeamEvent;
}
public function setIsTeamEvent(bool $isTeamEvent): self
{
$this->isTeamEvent = $isTeamEvent;
return $this;
}
/**
* @return Collection<int, Round>
*/
public function getRounds(): Collection
{
return $this->rounds;
}
public function addRound(Round $round): self
{
if (!$this->rounds->contains($round)) {
$this->rounds[] = $round;
$round->setEvent($this);
}
return $this;
}
public function removeRound(Round $round): self
{
if ($this->rounds->removeElement($round)) {
// set the owning side to null (unless already changed)
if ($round->getEvent() === $this) {
$round->setEvent(null);
}
}
return $this;
}
public function getRoundRobinRound(): ?string
{
return $this->roundRobinRound;
}
public function setRoundRobinRound(?string $roundRobinRound): self
{
$this->roundRobinRound = $roundRobinRound;
return $this;
}
/**
* @return Collection|Breakdown[]
*/
public function getBreakdowns(): Collection
{
return $this->breakdowns;
}
public function addBreakdown(Breakdown $breakdown): self
{
if (!$this->breakdowns->contains($breakdown)) {
$this->breakdowns[] = $breakdown;
$breakdown->setEvent($this);
}
return $this;
}
public function removeBreakdown(Breakdown $breakdown): self
{
if ($this->breakdowns->removeElement($breakdown)) {
// set the owning side to null (unless already changed)
if ($breakdown->getEvent() === $this) {
$breakdown->setEvent(null);
}
}
return $this;
}
}