src/Mm/Beton/Planungsatlas/AtlasBundle/Entity/Main/ThermalValue.php line 15

Open in your IDE?
  1. <?php
  2. namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Exception;
  5. /**
  6.  * Class ThermalValue
  7.  *
  8.  * @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="thermal_values")
  11.  */
  12. class ThermalValue extends AbstractModel implements HasParentModelInterface
  13. {
  14.     /**
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=5, nullable=false)
  22.      */
  23.     private $code;
  24.     /**
  25.      * @ORM\Column(type="string", length=10, nullable=false)
  26.      */
  27.     private $value;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity="ThermalParameter", inversedBy="thermalValues")
  30.      * @ORM\JoinColumn(name="thermal_parameter_id", referencedColumnName="id", nullable=false)
  31.      */
  32.     private $thermalParameter;
  33.     /**
  34.      * @return mixed
  35.      */
  36.     public function getId()
  37.     {
  38.         return $this->id;
  39.     }
  40.     /**
  41.      * @param mixed $id
  42.      */
  43.     public function setId($id)
  44.     {
  45.         $this->id $id;
  46.     }
  47.     /**
  48.      * @return mixed
  49.      */
  50.     public function getCode()
  51.     {
  52.         return $this->code;
  53.     }
  54.     /**
  55.      * @param mixed $code
  56.      */
  57.     public function setCode($code)
  58.     {
  59.         $this->code $code;
  60.     }
  61.     /**
  62.      * @return mixed
  63.      */
  64.     public function getValue()
  65.     {
  66.         return $this->value;
  67.     }
  68.     /**
  69.      * @param mixed $value
  70.      */
  71.     public function setValue($value)
  72.     {
  73.         $this->value $value;
  74.     }
  75.     /**
  76.      * @return mixed
  77.      */
  78.     public function getThermalParameter()
  79.     {
  80.         return $this->thermalParameter;
  81.     }
  82.     /**
  83.      * @param mixed $thermalParameter
  84.      */
  85.     public function setThermalParameter($thermalParameter)
  86.     {
  87.         $this->thermalParameter $thermalParameter;
  88.     }
  89.     /**
  90.      * {@inheritdoc}
  91.      */
  92.     public function setParentModel($parentModel)
  93.     {
  94.         if (!($parentModel instanceof ThermalParameter)) {
  95.             throw new Exception('invalid parent');
  96.         }
  97.         $this->setThermalParameter($parentModel);
  98.     }
  99. }