You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			92 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			PHP
		
	
			
		
		
	
	
			92 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			PHP
		
	
| <?php
 | |
| namespace App\Entity;
 | |
| 
 | |
| use Doctrine\Common\Collections\Collection;
 | |
| use Doctrine\Common\Collections\ArrayCollection;
 | |
| 
 | |
| class EventTeam
 | |
| {
 | |
| 
 | |
|     /**
 | |
|      *
 | |
|      * @var Event
 | |
|      */
 | |
|     private $event = null;
 | |
| 
 | |
|     private int $event_team_id = 0;
 | |
| 
 | |
|     private string $name = "";
 | |
| 
 | |
|     private Collection $heroes;
 | |
| 
 | |
|     public function __construct(Event $event, int $team_id, string $name)
 | |
|     {
 | |
|         $this->event = $event;
 | |
|         $this->event_team_id = $team_id;
 | |
|         $this->name = $name;
 | |
|         $this->heroes = new ArrayCollection();
 | |
|     }
 | |
| 
 | |
|     public function getName(): ?string
 | |
|     {
 | |
|         return $this->name;
 | |
|     }
 | |
| 
 | |
|     public function setName(string $name): self
 | |
|     {
 | |
|         $this->name = $name;
 | |
| 
 | |
|         return $this;
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      *
 | |
|      * @return Collection|EventHero[]
 | |
|      */
 | |
|     public function getHeroes(): Collection
 | |
|     {
 | |
|         return $this->heroes;
 | |
|     }
 | |
| 
 | |
|     public function addHero(EventHero $hero): self
 | |
|     {
 | |
|         if (! $this->heroes->contains($hero)) {
 | |
|             $this->heroes[] = $hero;
 | |
|             $hero->setTeam($this);
 | |
|         }
 | |
| 
 | |
|         return $this;
 | |
|     }
 | |
| 
 | |
|     public function removeHero(EventHero $hero): self
 | |
|     {
 | |
|         if ($this->heroes->contains($hero)) {
 | |
|             $this->heroes->removeElement($hero);
 | |
|             // set the owning side to null (unless already changed)
 | |
|             if ($hero->getTeam() === $this) {
 | |
|                 $hero->setTeam(null);
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         return $this;
 | |
|     }
 | |
| 
 | |
|     public function getEvent(): ?Event
 | |
|     {
 | |
|         return $this->event;
 | |
|     }
 | |
| 
 | |
|     public function setEvent(?Event $event): self
 | |
|     {
 | |
|         $this->event = $event;
 | |
| 
 | |
|         return $this;
 | |
|     }
 | |
| 
 | |
|     public function getEventTeamId(): ?int
 | |
|     {
 | |
|         return $this->event_team_id;
 | |
|     }
 | |
| }
 | |
| 
 |