<?php
namespace App\Entity\Player;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* PlayerAvailability
*
* @ORM\Table(name="tam_player_availability")
* @ORM\Entity(repositoryClass="App\Repository\Player\PlayerAvailabilityRepository")
*/
class PlayerAvailability
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="label", type="string", length=255, nullable=true)
*/
private $label;
/**
* @var string
*
* @ORM\Column(name="code_translate", type="string", length=255, nullable=false)
*/
private $codeTranslate;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @var integer
*
* @ORM\Column(name="indice", type="integer", options={"default": 0})
*/
private $indice;
/**
* @var integer
*
* @ORM\Column(name="old_id", type="integer", options={"default": 0})
*/
private $oldId;
/**
* @var ArrayCollection
*
* @ORM\ManyToMany(targetEntity="\App\Entity\Player\Player", mappedBy="availabilities")
*/
private $players;
public function __construct()
{
$this->players = new ArrayCollection();
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set label
*
* @param string $label
*
* @return PlayerAvailability
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set codeTranslate
*
* @param string $codeTranslate
*
* @return PlayerAvailability
*/
public function setCodeTranslate($codeTranslate)
{
$this->codeTranslate = $codeTranslate;
return $this;
}
/**
* Get codeTranslate
*
* @return string
*/
public function getCodeTranslate()
{
return $this->codeTranslate;
}
/**
* Set description
*
* @param string $description
*
* @return PlayerAvailability
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set indice
*
* @param integer $indice
*
* @return PlayerAvailability
*/
public function setIndice($indice)
{
$this->indice = $indice;
return $this;
}
/**
* Get indice
*
* @return integer
*/
public function getIndice()
{
return $this->indice;
}
/**
* Set oldId
*
* @param integer $oldId
*
* @return PlayerAvailability
*/
public function setOldId($oldId)
{
$this->oldId = $oldId;
return $this;
}
/**
* Get oldId
*
* @return integer
*/
public function getOldId()
{
return $this->oldId;
}
/**
* Add player
*
* @param \App\Entity\Player\Player $player
*
* @return PlayerAvailability
*/
public function addPlayer(\App\Entity\Player\Player $player)
{
$this->players[] = $player;
return $this;
}
/**
* Remove player
*
* @param \App\Entity\Player\Player $player
*/
public function removePlayer(\App\Entity\Player\Player $player)
{
$this->players->removeElement($player);
}
/**
* Get users
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPlayers()
{
return $this->players;
}
/***********************
* OTHER FUNCTION
***********************/
public function getArrayForJson(){
$array = array();
$array['id'] = $this->getId();
$array['label'] = $this->getLabel();
$array['codeTranslate'] = $this->getCodeTranslate();
return $array;
}
}