src/Entity/Ranking/RankingSystem.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Ranking;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. /**
  6.  * RankingSystem
  7.  *
  8.  * @ORM\Table(name="tam_ranking_system")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Ranking\RankingSystemRepository")
  10.  */
  11. class RankingSystem
  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 integer
  32.      *
  33.      * @ORM\Column(name="indice", type="integer", options={"default": 0})
  34.      */
  35.     private $indice;
  36.     
  37.     /**
  38.      * @var integer
  39.      *
  40.      * @ORM\Column(name="old_id", type="integer", options={"default": 0})
  41.      */
  42.     private $oldId;
  43.     
  44.     /**
  45.      * @var ArrayCollection
  46.      *
  47.      * @ORM\OneToMany(targetEntity="\App\Entity\Country", mappedBy="rankingSystem", cascade={"persist"}, orphanRemoval=true)
  48.      * @ORM\OrderBy({"label" = "ASC"})
  49.      */
  50.     private $countries;
  51.     
  52.     /**
  53.      * @var ArrayCollection
  54.      *
  55.      * @ORM\OneToMany(targetEntity="\App\Entity\Ranking\Ranking", mappedBy="rankingSystem", cascade={"persist"}, orphanRemoval=true)
  56.      * @ORM\OrderBy({"indice" = "ASC"})
  57.      */
  58.     private $rankings;
  59.     
  60.     /**
  61.      * @var ArrayCollection
  62.      *
  63.      * @ORM\OneToMany(targetEntity="\App\Entity\Player\Player", mappedBy="rankingSystem", cascade={"persist"}, orphanRemoval=true)
  64.      */
  65.     private $rankingPlayers;
  66.     
  67.     public function __construct()
  68.     {
  69.         $this->countries = new ArrayCollection();
  70.         $this->rankings = new ArrayCollection();
  71.         $this->rankingPlayers = new ArrayCollection();
  72.     }
  73.     /**
  74.      * Get id
  75.      *
  76.      * @return int
  77.      */
  78.     public function getId()
  79.     {
  80.         return $this->id;
  81.     }
  82.     
  83.     /**
  84.      * Set label
  85.      *
  86.      * @param string $label
  87.      *
  88.      * @return RankingSystem
  89.      */
  90.     public function setLabel($label)
  91.     {
  92.         $this->label $label;
  93.         return $this;
  94.     }
  95.     /**
  96.      * Get label
  97.      *
  98.      * @return string
  99.      */
  100.     public function getLabel()
  101.     {
  102.         return $this->label;
  103.     }
  104.     
  105.     
  106.     
  107.     /**
  108.      * Set indice
  109.      *
  110.      * @param integer $indice
  111.      *
  112.      * @return RankingSystem
  113.      */
  114.     public function setIndice($indice)
  115.     {
  116.         $this->indice $indice;
  117.         return $this;
  118.     }
  119.     /**
  120.      * Get indice
  121.      *
  122.      * @return integer
  123.      */
  124.     public function getIndice()
  125.     {
  126.         return $this->indice;
  127.     }
  128.     
  129.     /**
  130.      * Set oldId
  131.      *
  132.      * @param integer $oldId
  133.      *
  134.      * @return RankingSystem
  135.      */
  136.     public function setOldId($oldId)
  137.     {
  138.         $this->oldId $oldId;
  139.         return $this;
  140.     }
  141.     /**
  142.      * Get oldId
  143.      *
  144.      * @return integer
  145.      */
  146.     public function getOldId()
  147.     {
  148.         return $this->oldId;
  149.     }
  150.     
  151.     /**
  152.      * Get countries
  153.      *
  154.      * @return ArrayCollection
  155.      */
  156.     public function getCountries()
  157.     {
  158.         return $this->countries;
  159.     }
  160.     
  161.     /**
  162.      * Add country
  163.      *
  164.      * @param \App\Entity\Country $country
  165.      *
  166.      * @return RankingSystem
  167.      */
  168.     public function addCountry(\App\Entity\Country $country)
  169.     {
  170.         $country->setRankingSystem($this);
  171.         $this->countries[] = $country;
  172.         return $this;
  173.     }
  174.     /**
  175.      * Remove country
  176.      *
  177.      * @param \App\Entity\Country $country
  178.      */
  179.     public function removeCountry(\App\Entity\Country $country)
  180.     {
  181.         $this->countries->removeElement($country);
  182.     }
  183.     
  184.     /**
  185.      * Get rankings
  186.      *
  187.      * @return ArrayCollection
  188.      */
  189.     public function getRankings()
  190.     {
  191.         return $this->rankings;
  192.     }
  193.     
  194.     /**
  195.      * Add ranking
  196.      *
  197.      * @param \App\Entity\Ranking\Ranking $ranking
  198.      *
  199.      * @return RankingSystem
  200.      */
  201.     public function addRanking(\App\Entity\Ranking\Ranking $ranking)
  202.     {
  203.         $ranking->setRankingSystem($this);
  204.         $this->rankings[] = $country;
  205.         return $this;
  206.     }
  207.     /**
  208.      * Remove ranking
  209.      *
  210.      * @param \App\Entity\Ranking\Ranking $ranking
  211.      */
  212.     public function removeRanking(\App\Entity\Ranking\Ranking $ranking)
  213.     {
  214.         $this->rankings->removeElement($ranking);
  215.     }
  216.     
  217.     
  218.     /**
  219.      * Add rankingPlayer
  220.      *
  221.      * @param \App\Entity\Player\Player $player
  222.      *
  223.      * @return RankingSystem
  224.      */
  225.     public function addRankingPlayer(\App\Entity\Player\Player $player)
  226.     {
  227.         $user->setRankingSystem($this);
  228.         $this->rankingPlayers[] = $user;
  229.         return $this;
  230.     }
  231.     /**
  232.      * Remove rankingPlayer
  233.      *
  234.      * @param \App\Entity\Player\Player $player
  235.      */
  236.     public function removeRankingPlayer(\App\Entity\Player\Player $player)
  237.     {
  238.         $this->rankingPlayers->removeElement($player);
  239.     }
  240.     
  241.     /**
  242.      * Get rankingPlayers
  243.      *
  244.      * @return ArrayCollection
  245.      */
  246.     public function getRankingPlayers()
  247.     {
  248.         return $this->rankingPlayers;
  249.     }
  250.     
  251.     
  252.     
  253.     
  254. }