src/Entity/TeamSeason.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TeamSeasonRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassTeamSeasonRepository::class)]
  6. class TeamSeason
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\ManyToOne(inversedBy'teamSeasons')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private ?Team $team null;
  15.     #[ORM\ManyToOne(inversedBy'teamSeasons')]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?Season $season null;
  18.     #[ORM\Column]
  19.     private ?int $totalPoints null;
  20.     public function __construct()
  21.     {
  22.         $this->totalPoints 0;
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getTeam(): ?Team
  29.     {
  30.         return $this->team;
  31.     }
  32.     public function setTeam(?Team $team): static
  33.     {
  34.         $this->team $team;
  35.         return $this;
  36.     }
  37.     public function getSeason(): ?Season
  38.     {
  39.         return $this->season;
  40.     }
  41.     public function setSeason(?Season $season): static
  42.     {
  43.         $this->season $season;
  44.         return $this;
  45.     }
  46.     public function getTotalPoints(): ?int
  47.     {
  48.         return $this->totalPoints;
  49.     }
  50.     public function setTotalPoints(int $totalPoints): static
  51.     {
  52.         $this->totalPoints $totalPoints;
  53.         return $this;
  54.     }
  55.     /**
  56.      * Add points to the team's total
  57.      */
  58.     public function addPoints(int $points): static
  59.     {
  60.         $this->totalPoints += $points;
  61.         return $this;
  62.     }
  63. }