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