src/Entity/Player/PlayerAvailability.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.  * PlayerAvailability
  7.  *
  8.  * @ORM\Table(name="tam_player_availability")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Player\PlayerAvailabilityRepository")
  10.  */
  11. class PlayerAvailability
  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 string
  31.      *
  32.      * @ORM\Column(name="code_translate", type="string", length=255, nullable=false)
  33.      */
  34.     private $codeTranslate;
  35.     
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="description", type="text", nullable=true)
  40.      */
  41.     private $description;
  42.     
  43.     /**
  44.      * @var integer
  45.      *
  46.      * @ORM\Column(name="indice", type="integer", options={"default": 0})
  47.      */
  48.     private $indice;
  49.     
  50.     /**
  51.      * @var integer
  52.      *
  53.      * @ORM\Column(name="old_id", type="integer", options={"default": 0})
  54.      */
  55.     private $oldId;
  56.     
  57.     /**
  58.      * @var ArrayCollection
  59.      *
  60.      * @ORM\ManyToMany(targetEntity="\App\Entity\Player\Player", mappedBy="availabilities")
  61.      */
  62.     private $players;
  63.     
  64.     public function __construct()
  65.     {
  66.         $this->players = new ArrayCollection();
  67.      
  68.     }
  69.     /**
  70.      * Get id
  71.      *
  72.      * @return int
  73.      */
  74.     public function getId()
  75.     {
  76.         return $this->id;
  77.     }
  78.     
  79.     /**
  80.      * Set label
  81.      *
  82.      * @param string $label
  83.      *
  84.      * @return PlayerAvailability
  85.      */
  86.     public function setLabel($label)
  87.     {
  88.         $this->label $label;
  89.         return $this;
  90.     }
  91.     /**
  92.      * Get label
  93.      *
  94.      * @return string
  95.      */
  96.     public function getLabel()
  97.     {
  98.         return $this->label;
  99.     }
  100.     
  101.     /**
  102.      * Set codeTranslate
  103.      *
  104.      * @param string $codeTranslate
  105.      *
  106.      * @return PlayerAvailability
  107.      */
  108.     public function setCodeTranslate($codeTranslate)
  109.     {
  110.         $this->codeTranslate $codeTranslate;
  111.         return $this;
  112.     }
  113.     /**
  114.      * Get codeTranslate
  115.      *
  116.      * @return string
  117.      */
  118.     public function getCodeTranslate()
  119.     {
  120.         return $this->codeTranslate;
  121.     }
  122.     
  123.     /**
  124.      * Set description
  125.      *
  126.      * @param string $description
  127.      *
  128.      * @return PlayerAvailability
  129.      */
  130.     public function setDescription($description)
  131.     {
  132.         $this->description $description;
  133.         return $this;
  134.     }
  135.     /**
  136.      * Get description
  137.      *
  138.      * @return string
  139.      */
  140.     public function getDescription()
  141.     {
  142.         return $this->description;
  143.     }
  144.     
  145.     
  146.     /**
  147.      * Set indice
  148.      *
  149.      * @param integer $indice
  150.      *
  151.      * @return PlayerAvailability
  152.      */
  153.     public function setIndice($indice)
  154.     {
  155.         $this->indice $indice;
  156.         return $this;
  157.     }
  158.     /**
  159.      * Get indice
  160.      *
  161.      * @return integer
  162.      */
  163.     public function getIndice()
  164.     {
  165.         return $this->indice;
  166.     }
  167.     
  168.     /**
  169.      * Set oldId
  170.      *
  171.      * @param integer $oldId
  172.      *
  173.      * @return PlayerAvailability
  174.      */
  175.     public function setOldId($oldId)
  176.     {
  177.         $this->oldId $oldId;
  178.         return $this;
  179.     }
  180.     /**
  181.      * Get oldId
  182.      *
  183.      * @return integer
  184.      */
  185.     public function getOldId()
  186.     {
  187.         return $this->oldId;
  188.     }
  189.     
  190.     /**
  191.      * Add player
  192.      *
  193.      * @param \App\Entity\Player\Player $player
  194.      *
  195.      * @return PlayerAvailability
  196.      */
  197.     public function addPlayer(\App\Entity\Player\Player $player)
  198.     {
  199.         $this->players[] = $player;
  200.         return $this;
  201.     }
  202.     /**
  203.      * Remove player
  204.      *
  205.      * @param \App\Entity\Player\Player $player
  206.      */
  207.     public function removePlayer(\App\Entity\Player\Player $player)
  208.     {
  209.         $this->players->removeElement($player);
  210.     }
  211.     /**
  212.      * Get users
  213.      *
  214.      * @return \Doctrine\Common\Collections\Collection
  215.      */
  216.     public function getPlayers()
  217.     {
  218.         return $this->players;
  219.     }
  220.     
  221.     
  222.     /***********************
  223.      * OTHER FUNCTION
  224.      ***********************/
  225.     
  226.     public function getArrayForJson(){
  227.         $array = array();
  228.         $array['id'] = $this->getId();
  229.         $array['label'] = $this->getLabel();
  230.         $array['codeTranslate'] = $this->getCodeTranslate();
  231.         
  232.         return $array;
  233.         
  234.     }
  235.     
  236.     
  237.     
  238.     
  239. }