src/Entity/Player/PlayerNbTournamentByYear.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Player;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. /**
  6.  * PlayerNbTournamentByYear
  7.  *
  8.  * @ORM\Table(name="tam_player_nb_tournament_by_year")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Player\PlayerNbTournamentByYearRepository")
  10.  */
  11. class PlayerNbTournamentByYear
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="id", type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="IDENTITY")
  19.      */
  20.     private $id;
  21.     
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="label", type="string", length=255, nullable=true)
  26.      */
  27.     private $label;
  28.     
  29.     /**
  30.      * @var integer
  31.      *
  32.      * @ORM\Column(name="indice", type="integer", options={"default": 0})
  33.      */
  34.     private $indice
  35.     
  36.     /**
  37.      * @var ArrayCollection $players
  38.      *
  39.      * @ORM\OneToMany(targetEntity="\App\Entity\Player\Player", mappedBy="nbTournamentByYear")
  40.      */
  41.     private $players;
  42.     
  43.     public function __construct()
  44.     {
  45.         $this->players = new ArrayCollection();
  46.      
  47.     }
  48.     /**
  49.      * Get id
  50.      *
  51.      * @return int
  52.      */
  53.     public function getId()
  54.     {
  55.         return $this->id;
  56.     }
  57.     
  58.     /**
  59.      * Set label
  60.      *
  61.      * @param string $label
  62.      *
  63.      * @return PlayerNbTournamentByYear
  64.      */
  65.     public function setLabel($label)
  66.     {
  67.         $this->label $label;
  68.         return $this;
  69.     }
  70.     /**
  71.      * Get label
  72.      *
  73.      * @return string
  74.      */
  75.     public function getLabel()
  76.     {
  77.         return $this->label;
  78.     }
  79.     
  80.     /**
  81.      * Set indice
  82.      *
  83.      * @param integer $indice
  84.      *
  85.      * @return PlayerNbTournamentByYear
  86.      */
  87.     public function setIndice($indice)
  88.     {
  89.         $this->indice $indice;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Get indice
  94.      *
  95.      * @return integer
  96.      */
  97.     public function getIndice()
  98.     {
  99.         return $this->indice;
  100.     }
  101.     
  102.     /**
  103.      * Add player
  104.      *
  105.      * @param \App\Entity\Player\Player $player
  106.      *
  107.      * @return PlayerNbTournamentByYear
  108.      */
  109.     public function addPlayer(\App\Entity\Player\Player $player)
  110.     {
  111.         $this->players[] = $player;
  112.         return $this;
  113.     }
  114.     /**
  115.      * Remove player
  116.      *
  117.      * @param \App\Entity\Player\Player $user
  118.      */
  119.     public function removePlayer(\App\Entity\Player\Player $player)
  120.     {
  121.         $this->players->removeElement($player);
  122.     }
  123.     /**
  124.      * Get users
  125.      *
  126.      * @return \Doctrine\Common\Collections\Collection
  127.      */
  128.     public function getPlayers()
  129.     {
  130.         return $this->players;
  131.     }
  132.     
  133.     
  134.     
  135.     /***********************
  136.      * OTHER FUNCTION
  137.      ***********************/
  138.     
  139.     public function getArrayForJson(){
  140.         $array = array();
  141.         $array['id'] = $this->getId();
  142.         $array['label'] = $this->getLabel();
  143.         
  144.         return $array;
  145.         
  146.     }
  147.     
  148.     
  149. }