<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Surface
*
* @ORM\Table(name="tam_surfaces")
* @ORM\Entity(repositoryClass="App\Repository\SurfaceRepository")
*/
class Surface
{
/**
* @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\OneToMany(targetEntity="\App\Entity\Club\ClubSurface", mappedBy="surface", cascade={"persist", "remove"}, orphanRemoval=true)
*/
private $clubSurfaces;
/**
* @var ArrayCollection
*
* @ORM\OneToMany(targetEntity="\App\Entity\Event\EventClub", mappedBy="surface", cascade={"persist", "remove"}, orphanRemoval=true)
*/
private $events;
public function __construct()
{
$this->clubSurfaces = new ArrayCollection();
$this->events = new ArrayCollection();
}
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set label
*
* @param string $label
*
* @return Surface
*/
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 Surface
*/
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 Surface
*/
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 Surface
*/
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 Surface
*/
public function setOldId($oldId)
{
$this->oldId = $oldId;
return $this;
}
/**
* Get oldId
*
* @return integer
*/
public function getOldId()
{
return $this->oldId;
}
/**
* Add clubSurface
*
* @param \App\Entity\Club\ClubSurface $clubSurface
*
* @return Surface
*/
public function addClubSurface(\App\Entity\Club\ClubSurface $clubSurface)
{
$this->clubSurfaces[] = $clubSurface;
return $this;
}
/**
* Remove clubSurface
*
* @param \App\Entity\Club\ClubSurface $clubSurface
*/
public function removeClubSurface(\App\Entity\Club\ClubSurface $clubSurface)
{
$this->clubSurfaces->removeElement($clubSurface);
}
/**
* Get clubSurfaces
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getClubSurfaces()
{
return $this->clubSurfaces;
}
/**
* Add event
*
* @param \App\Entity\Event\EventClub $event
*
* @return Surface
*/
public function addEvent(\App\Entity\Event\EventClub $event)
{
$this->events[] = $event;
return $this;
}
/**
* Remove event
*
* @param \App\Entity\Event\EventClub $event
*/
public function removeEvent(\App\Entity\Event\EventClub $event)
{
$this->events->removeElement($event);
}
/**
* Get events
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getEvents()
{
return $this->events;
}
/***********************
* OTHER FUNCTION
***********************/
public function getArrayForJson(){
$array = array();
$array['id'] = $this->getId();
$array['label'] = $this->getLabel();
$array['codeTranslate'] = $this->getCodeTranslate();
return $array;
}
}