<?php
namespace App\Entity;
use App\Repository\RegionClubRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=RegionClubRepository::class)
* @ORM\Table(name="region_clubs")
*/
class RegionClub
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\Column(type="string", length=255)
*/
private string $title = "";
/**
* @ORM\OneToMany(targetEntity=Club::class, mappedBy="region")
*/
private ?Collection $clubs;
public function __construct()
{
$this->clubs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getLowPercent(): ?int
{
return $this->low_percent;
}
public function setLowPercent(int $low_percent): self
{
$this->low_percent = $low_percent;
return $this;
}
public function getHighPercent(): ?int
{
return $this->high_percent;
}
public function setHighPercent(int $high_percent): self
{
$this->high_percent = $high_percent;
return $this;
}
/**
* @return Collection|null
*/
public function getClubs(): ?Collection
{
return $this->clubs;
}
public function addClub(Club $club): self
{
if (!$this->clubs->contains($club)) {
$this->clubs[] = $club;
$club->setRegion($this);
}
return $this;
}
public function removeClub(Club $club): self
{
if ($this->clubs->removeElement($club)) {
// set the owning side to null (unless already changed)
if ($club->getRegion() === $this) {
$club->setRegion(null);
}
}
return $this;
}
}