src/Entity/RegionClub.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RegionClubRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=RegionClubRepository::class)
  9.  * @ORM\Table(name="region_clubs")
  10.  */
  11. class RegionClub
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private ?int $id null;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private string $title "";
  23.     /**
  24.      * @ORM\OneToMany(targetEntity=Club::class, mappedBy="region")
  25.      */
  26.     private ?Collection $clubs;
  27.     public function __construct()
  28.     {
  29.         $this->clubs = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getTitle(): ?string
  36.     {
  37.         return $this->title;
  38.     }
  39.     public function setTitle(string $title): self
  40.     {
  41.         $this->title $title;
  42.         return $this;
  43.     }
  44.     public function getLowPercent(): ?int
  45.     {
  46.         return $this->low_percent;
  47.     }
  48.     public function setLowPercent(int $low_percent): self
  49.     {
  50.         $this->low_percent $low_percent;
  51.         return $this;
  52.     }
  53.     public function getHighPercent(): ?int
  54.     {
  55.         return $this->high_percent;
  56.     }
  57.     public function setHighPercent(int $high_percent): self
  58.     {
  59.         $this->high_percent $high_percent;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return Collection|null
  64.      */
  65.     public function getClubs(): ?Collection
  66.     {
  67.         return $this->clubs;
  68.     }
  69.     public function addClub(Club $club): self
  70.     {
  71.         if (!$this->clubs->contains($club)) {
  72.             $this->clubs[] = $club;
  73.             $club->setRegion($this);
  74.         }
  75.         return $this;
  76.     }
  77.     public function removeClub(Club $club): self
  78.     {
  79.         if ($this->clubs->removeElement($club)) {
  80.             // set the owning side to null (unless already changed)
  81.             if ($club->getRegion() === $this) {
  82.                 $club->setRegion(null);
  83.             }
  84.         }
  85.         return $this;
  86.     }
  87. }