<?php
namespace App\Entity;
use App\Repository\RoundRepository;
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=RoundRepository::class)
*/
class Round
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"round:list","round:item","event:list", "event:item"})
*/
private $id;
/**
* @ORM\Column(type="integer")
* @Groups({"round:list","round:item","event:list", "event:item"})
*/
private $roundId;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"round:list","round:item","event:list", "event:item"})
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"round:list","round:item","event:list", "event:item"})
*/
private $shortName;
/**
* @ORM\OneToMany(targetEntity=Fixture::class, mappedBy="round")
* @Groups({"round:list","round:item","event:list", "event:item"})
*/
private $fixtures;
/**
* @ORM\ManyToOne(targetEntity=Event::class, inversedBy="rounds")
* @Groups({"round:list","round:item"})
*/
private $event;
public function __construct()
{
$this->fixtures = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getRoundId(): ?int
{
return $this->roundId;
}
public function setRoundId(int $roundId): self
{
$this->roundId = $roundId;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, Fixture>
*/
public function getFixtures(): Collection
{
return $this->fixtures;
}
public function addFixture(Fixture $fixture): self
{
if (!$this->fixtures->contains($fixture)) {
$this->fixtures[] = $fixture;
$fixture->setRound($this);
}
return $this;
}
public function removeFixture(Fixture $fixture): self
{
if ($this->fixtures->removeElement($fixture)) {
// set the owning side to null (unless already changed)
if ($fixture->getRound() === $this) {
$fixture->setRound(null);
}
}
return $this;
}
public function getEvent(): ?Event
{
return $this->event;
}
public function setEvent(?Event $event): self
{
$this->event = $event;
return $this;
}
/**
* @return mixed
*/
public function getShortName()
{
return $this->shortName;
}
/**
* @param mixed $shortName
*/
public function setShortName($shortName): void
{
$this->shortName = $shortName;
}
}