src/Entity/ElementMesure.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. /**
  4.  * ElementMesure.
  5.  */
  6. class ElementMesure
  7. {
  8.     /**
  9.      * @var int
  10.      */
  11.     private $id;
  12.     /**
  13.      * @var string
  14.      */
  15.     private $code;
  16.     /**
  17.      * @var string
  18.      */
  19.     private $titre;
  20.     /**
  21.      * @var string
  22.      */
  23.     private $description;
  24.     /**
  25.      * @var int
  26.      */
  27.     private $rang;
  28.     /**
  29.      * @var string
  30.      */
  31.     private $cas;
  32.     /**
  33.      * @var int
  34.      */
  35.     private $idBdOrigine;
  36.     /**
  37.      * @var \Doctrine\Common\Collections\Collection
  38.      */
  39.     private $ValeursMesures;
  40.     /**
  41.      * @var \Doctrine\Common\Collections\Collection
  42.      */
  43.     private $FamilleElementMesure;
  44.     /**
  45.      * Constructor.
  46.      */
  47.     public function __construct()
  48.     {
  49.         $this->ValeursMesures = new \Doctrine\Common\Collections\ArrayCollection();
  50.         $this->FamilleElementMesure = new \Doctrine\Common\Collections\ArrayCollection();
  51.     }
  52.     public function __toString()
  53.     {
  54.         if (is_null($this->titre) or == strlen($this->titre)) {
  55.             return '';
  56.         }
  57.         return $this->titre;
  58.     }
  59.     public function getNomComplet()
  60.     {
  61.         $cas $this->getCas();
  62.         $unite $this->getUnite();
  63.         $titre $this->getTitre();
  64.         if ($cas) {
  65.             $titre .= " / $cas";
  66.         }
  67.         if ($unite) {
  68.             $titre .= " ($unite)";
  69.         }
  70.         return $titre;
  71.     }
  72.     /**
  73.      * Get id.
  74.      *
  75.      * @return int
  76.      */
  77.     public function getId()
  78.     {
  79.         return $this->id;
  80.     }
  81.     /**
  82.      * Set code.
  83.      *
  84.      * @param string $code
  85.      *
  86.      * @return ElementMesure
  87.      */
  88.     public function setCode($code)
  89.     {
  90.         $this->code $code;
  91.         return $this;
  92.     }
  93.     /**
  94.      * Get code.
  95.      *
  96.      * @return string
  97.      */
  98.     public function getCode()
  99.     {
  100.         return $this->code;
  101.     }
  102.     /**
  103.      * Set titre.
  104.      *
  105.      * @param string $titre
  106.      *
  107.      * @return ElementMesure
  108.      */
  109.     public function setTitre($titre)
  110.     {
  111.         $this->titre $titre;
  112.         return $this;
  113.     }
  114.     /**
  115.      * Get titre.
  116.      *
  117.      * @return string
  118.      */
  119.     public function getTitre()
  120.     {
  121.         return $this->titre;
  122.     }
  123.     /**
  124.      * Set description.
  125.      *
  126.      * @param string $description
  127.      *
  128.      * @return ElementMesure
  129.      */
  130.     public function setDescription($description)
  131.     {
  132.         $this->description $description;
  133.         return $this;
  134.     }
  135.     /**
  136.      * Get description.
  137.      *
  138.      * @return string
  139.      */
  140.     public function getDescription()
  141.     {
  142.         return $this->description;
  143.     }
  144.     /**
  145.      * Set rang.
  146.      *
  147.      * @param int $rang
  148.      *
  149.      * @return ElementMesure
  150.      */
  151.     public function setRang($rang)
  152.     {
  153.         $this->rang $rang;
  154.         return $this;
  155.     }
  156.     /**
  157.      * Get rang.
  158.      *
  159.      * @return int
  160.      */
  161.     public function getRang()
  162.     {
  163.         return $this->rang;
  164.     }
  165.     /**
  166.      * Set cas.
  167.      *
  168.      * @param string $cas
  169.      *
  170.      * @return ElementMesure
  171.      */
  172.     public function setCas($cas)
  173.     {
  174.         $this->cas $cas;
  175.         return $this;
  176.     }
  177.     /**
  178.      * Get cas.
  179.      *
  180.      * @return string
  181.      */
  182.     public function getCas()
  183.     {
  184.         return $this->cas;
  185.     }
  186.     /**
  187.      * Set idBdOrigine.
  188.      *
  189.      * @param int $idBdOrigine
  190.      *
  191.      * @return ElementMesure
  192.      */
  193.     public function setIdBdOrigine($idBdOrigine)
  194.     {
  195.         $this->idBdOrigine $idBdOrigine;
  196.         return $this;
  197.     }
  198.     /**
  199.      * Get idBdOrigine.
  200.      *
  201.      * @return int
  202.      */
  203.     public function getIdBdOrigine()
  204.     {
  205.         return $this->idBdOrigine;
  206.     }
  207.     /**
  208.      * Add valeursMesure.
  209.      *
  210.      * @param \App\Entity\ValeursMesures $valeursMesure
  211.      *
  212.      * @return ElementMesure
  213.      */
  214.     public function addValeursMesure(ValeursMesures $valeursMesure)
  215.     {
  216.         $this->ValeursMesures[] = $valeursMesure;
  217.         return $this;
  218.     }
  219.     /**
  220.      * Remove valeursMesure.
  221.      *
  222.      * @param \App\Entity\ValeursMesures $valeursMesure
  223.      */
  224.     public function removeValeursMesure(ValeursMesures $valeursMesure)
  225.     {
  226.         $this->ValeursMesures->removeElement($valeursMesure);
  227.     }
  228.     /**
  229.      * Get valeursMesures.
  230.      *
  231.      * @return \Doctrine\Common\Collections\Collection
  232.      */
  233.     public function getValeursMesures()
  234.     {
  235.         return $this->ValeursMesures;
  236.     }
  237.     /**
  238.      * Add familleElementMesure.
  239.      *
  240.      * @param \App\Entity\FamilleElementMesure $familleElementMesure
  241.      *
  242.      * @return ElementMesure
  243.      */
  244.     public function addFamilleElementMesure(FamilleElementMesure $familleElementMesure)
  245.     {
  246.         $this->FamilleElementMesure[] = $familleElementMesure;
  247.         return $this;
  248.     }
  249.     /**
  250.      * Remove familleElementMesure.
  251.      *
  252.      * @param \App\Entity\FamilleElementMesure $familleElementMesure
  253.      */
  254.     public function removeFamilleElementMesure(FamilleElementMesure $familleElementMesure)
  255.     {
  256.         $this->FamilleElementMesure->removeElement($familleElementMesure);
  257.     }
  258.     /**
  259.      * Get familleElementMesure.
  260.      *
  261.      * @return \Doctrine\Common\Collections\Collection
  262.      */
  263.     public function getFamilleElementMesure()
  264.     {
  265.         return $this->FamilleElementMesure;
  266.     }
  267.     /**
  268.      * @var string
  269.      */
  270.     private $unite;
  271.     /**
  272.      * Set unite.
  273.      *
  274.      * @param string $unite
  275.      *
  276.      * @return ElementMesure
  277.      */
  278.     public function setUnite($unite)
  279.     {
  280.         $this->unite $unite;
  281.         return $this;
  282.     }
  283.     /**
  284.      * Get unite.
  285.      *
  286.      * @return string
  287.      */
  288.     public function getUnite()
  289.     {
  290.         return $this->unite;
  291.     }
  292. }