<?php
namespace App\Entity\Player;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* PlayerNbTournamentByYear
*
* @ORM\Table(name="tam_player_nb_tournament_by_year")
* @ORM\Entity(repositoryClass="App\Repository\Player\PlayerNbTournamentByYearRepository")
*/
class PlayerNbTournamentByYear
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="label", type="string", length=255, nullable=true)
*/
private $label;
/**
* @var integer
*
* @ORM\Column(name="indice", type="integer", options={"default": 0})
*/
private $indice;
/**
* @var ArrayCollection $players
*
* @ORM\OneToMany(targetEntity="\App\Entity\Player\Player", mappedBy="nbTournamentByYear")
*/
private $players;
public function __construct()
{
$this->players = new ArrayCollection();
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set label
*
* @param string $label
*
* @return PlayerNbTournamentByYear
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set indice
*
* @param integer $indice
*
* @return PlayerNbTournamentByYear
*/
public function setIndice($indice)
{
$this->indice = $indice;
return $this;
}
/**
* Get indice
*
* @return integer
*/
public function getIndice()
{
return $this->indice;
}
/**
* Add player
*
* @param \App\Entity\Player\Player $player
*
* @return PlayerNbTournamentByYear
*/
public function addPlayer(\App\Entity\Player\Player $player)
{
$this->players[] = $player;
return $this;
}
/**
* Remove player
*
* @param \App\Entity\Player\Player $user
*/
public function removePlayer(\App\Entity\Player\Player $player)
{
$this->players->removeElement($player);
}
/**
* Get users
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPlayers()
{
return $this->players;
}
/***********************
* OTHER FUNCTION
***********************/
public function getArrayForJson(){
$array = array();
$array['id'] = $this->getId();
$array['label'] = $this->getLabel();
return $array;
}
}