<?php
namespace App\Entity;
use App\Repository\DrawLineRepository;
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=DrawLineRepository::class)
*/
class DrawLine
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
*/
private $id;
/**
* @ORM\Column(type="integer")
* @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
*/
private $drawLine;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
*/
private $seed;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
*/
private $teamCode;
/**
* @ORM\Column(type="integer")
* @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
*/
private $seedingRank;
/**
* @ORM\ManyToMany(targetEntity=Player::class, inversedBy="drawLines")
* @Groups({"round:list", "round:item","drawline:list", "drawline:item","event:list","event:item"})
*/
private $players;
/**
* @ORM\OneToOne(targetEntity=Fixture::class, mappedBy="drawLineTop", cascade={"persist", "remove"})
*/
private $fixture;
public function __construct()
{
$this->players = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getSeed(): ?string
{
return $this->seed;
}
public function setSeed(?string $seed): self
{
$this->seed = $seed;
return $this;
}
public function getTeamCode(): ?string
{
return $this->teamCode;
}
public function setTeamCode(?string $teamCode): self
{
$this->teamCode = $teamCode;
return $this;
}
public function getSeedingRank(): ?int
{
return $this->seedingRank;
}
public function setSeedingRank(int $seedingRank): self
{
$this->seedingRank = $seedingRank;
return $this;
}
/**
* @return Collection<int, Player>
*/
public function getPlayers(): Collection
{
return $this->players;
}
public function clearPlayers()
{
$this->players = new ArrayCollection();
}
public function addPlayer(Player $player): self
{
if (!$this->players->contains($player)) {
$this->players[] = $player;
}
return $this;
}
public function removePlayer(Player $player): self
{
$this->players->removeElement($player);
return $this;
}
public function getFixture(): ?Fixture
{
return $this->fixture;
}
public function setFixture(Fixture $fixture): self
{
// set the owning side of the relation if necessary
if ($fixture->getDrawLineTop() !== $this) {
$fixture->setDrawLineTop($this);
}
$this->fixture = $fixture;
return $this;
}
/**
* @return mixed
*/
public function getDrawLine()
{
return $this->drawLine;
}
/**
* @param mixed $drawLine
*/
public function setDrawLine($drawLine): void
{
$this->drawLine = $drawLine;
}
}