src/Entity/Tam/TamType.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Tam;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. /**
  6.  * TamType
  7.  *
  8.  * @ORM\Table(name="tam_tam_type")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Tam\TamTypeRepository")
  10.  */
  11. class TamType
  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 string
  45.      *
  46.      * @ORM\Column(name="description_code_translate", type="string", length=255, nullable=false)
  47.      */
  48.     private $descriptionCodeTranslate;
  49.     
  50.     /**
  51.      * @var integer
  52.      *
  53.      * @ORM\Column(name="indice", type="integer", options={"default": 0})
  54.      */
  55.     private $indice;
  56.     
  57.     /**
  58.      * @var integer
  59.      *
  60.      * @ORM\Column(name="old_id", type="integer", options={"default": 0})
  61.      */
  62.     private $oldId;
  63.     
  64.     /**
  65.      * @var ArrayCollection
  66.      *
  67.      * @ORM\OneToMany(targetEntity="\App\Entity\Tam\Tam", mappedBy="tamType", cascade={"persist"}, orphanRemoval=true)
  68.      */
  69.     private $tams;
  70.     
  71.     
  72.     public function __construct()
  73.     {
  74.         $this->tams = new ArrayCollection();
  75.     }
  76.     /**
  77.      * Get id
  78.      *
  79.      * @return int
  80.      */
  81.     public function getId()
  82.     {
  83.         return $this->id;
  84.     }
  85.     
  86.     /**
  87.      * Set label
  88.      *
  89.      * @param string $label
  90.      *
  91.      * @return RequestType
  92.      */
  93.     public function setLabel($label)
  94.     {
  95.         $this->label $label;
  96.         return $this;
  97.     }
  98.     /**
  99.      * Get label
  100.      *
  101.      * @return string
  102.      */
  103.     public function getLabel()
  104.     {
  105.         return $this->label;
  106.     }
  107.     
  108.     /**
  109.      * Set codeTranslate
  110.      *
  111.      * @param string $codeTranslate
  112.      *
  113.      * @return RequestType
  114.      */
  115.     public function setCodeTranslate($codeTranslate)
  116.     {
  117.         $this->codeTranslate $codeTranslate;
  118.         return $this;
  119.     }
  120.     /**
  121.      * Get codeTranslate
  122.      *
  123.      * @return string
  124.      */
  125.     public function getCodeTranslate()
  126.     {
  127.         return $this->codeTranslate;
  128.     }
  129.     
  130.     /**
  131.      * Set description
  132.      *
  133.      * @param string $description
  134.      *
  135.      * @return RequestType
  136.      */
  137.     public function setDescription($description)
  138.     {
  139.         $this->description $description;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get description
  144.      *
  145.      * @return string
  146.      */
  147.     public function getDescription()
  148.     {
  149.         return $this->description;
  150.     }
  151.     
  152.     /**
  153.      * Set descriptionCodeTranslate
  154.      *
  155.      * @param string $descriptionCodeTranslate
  156.      *
  157.      * @return RequestType
  158.      */
  159.     public function setDescriptionCodeTranslate($descriptionCodeTranslate)
  160.     {
  161.         $this->descriptionCodeTranslate $descriptionCodeTranslate;
  162.         return $this;
  163.     }
  164.     /**
  165.      * Get descriptionCodeTranslate
  166.      *
  167.      * @return string
  168.      */
  169.     public function getDescriptionCodeTranslate()
  170.     {
  171.         return $this->descriptionCodeTranslate;
  172.     }
  173.     
  174.     
  175.     /**
  176.      * Set indice
  177.      *
  178.      * @param integer $indice
  179.      *
  180.      * @return RequestType
  181.      */
  182.     public function setIndice($indice)
  183.     {
  184.         $this->indice $indice;
  185.         return $this;
  186.     }
  187.     /**
  188.      * Get indice
  189.      *
  190.      * @return integer
  191.      */
  192.     public function getIndice()
  193.     {
  194.         return $this->indice;
  195.     }
  196.     
  197.     /**
  198.      * Set oldId
  199.      *
  200.      * @param integer $oldId
  201.      *
  202.      * @return RequestType
  203.      */
  204.     public function setOldId($oldId)
  205.     {
  206.         $this->oldId $oldId;
  207.         return $this;
  208.     }
  209.     /**
  210.      * Get oldId
  211.      *
  212.      * @return integer
  213.      */
  214.     public function getOldId()
  215.     {
  216.         return $this->oldId;
  217.     }
  218.     
  219.     /**
  220.      * Add tam
  221.      *
  222.      * @param \App\Entity\Tam\Tam $tam
  223.      *
  224.      * @return TamType
  225.      */
  226.     public function addTam(\App\Entity\Tam\Tam $tam)
  227.     {
  228.         $this->tams[] = $tam;
  229.         return $this;
  230.     }
  231.     /**
  232.      * Remove tam
  233.      *
  234.      * @param \App\Entity\Tam\Tam $tam
  235.      */
  236.     public function removeTam(\App\Entity\Tam\Tam $tam)
  237.     {
  238.         $this->tams->removeElement($tam);
  239.     }
  240.     /**
  241.      * Get tams
  242.      *
  243.      * @return \Doctrine\Common\Collections\Collection
  244.      */
  245.     public function getTams()
  246.     {
  247.         return $this->tams;
  248.     }
  249.     
  250.     
  251.     /***********************
  252.      * OTHER FUNCTION
  253.      ***********************/
  254.     
  255.     public function getArrayForJson(){
  256.         $array = array();
  257.         $array['id'] = $this->getId();
  258.         $array['label'] = $this->getLabel();
  259.         $array['codeTranslate'] = $this->getCodeTranslate();
  260.         
  261.         return $array;
  262.         
  263.     }
  264.     
  265.     
  266.     
  267. }