src/Entity/Brand/BrandRacket.php line 15

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