src/Mm/Beton/Planungsatlas/AtlasBundle/Entity/Main/ThermalParameter.php line 16

Open in your IDE?
  1. <?php
  2. namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Exception;
  6. /**
  7.  * Class ThermalParameter
  8.  *
  9.  * @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
  10.  * @ORM\Entity
  11.  * @ORM\Table(name="thermal_parameters")
  12.  */
  13. class ThermalParameter extends AbstractModel implements HasParentModelInterface
  14. {
  15.     /**
  16.      * @ORM\Column(type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=5, nullable=false)
  23.      */
  24.     private $code;
  25.     /**
  26.      * @ORM\Column(type="string", length=128, nullable=false)
  27.      */
  28.     private $name;
  29.     /**
  30.      * @ORM\Column(type="string", length=5, nullable=true)
  31.      */
  32.     private $position;
  33.     /**
  34.      * @ORM\Column(type="string", length=5, nullable=false)
  35.      */
  36.     private $variable;
  37.     /**
  38.      * @ORM\Column(type="string", length=7, nullable=false)
  39.      */
  40.     private $unit;
  41.     /**
  42.      * @var ArrayCollection
  43.      * @ORM\OneToMany(targetEntity="ThermalValue", mappedBy="thermalParameter")
  44.      */
  45.     private $thermalValues;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity="ConstructionElement", inversedBy="thermalParameters")
  48.      * @ORM\JoinColumn(name="construction_element_id", referencedColumnName="id", nullable=false)
  49.      */
  50.     private $constructionElement;
  51.     /**
  52.      * Constructor
  53.      */
  54.     public function __construct()
  55.     {
  56.         $this->thermalValues = new ArrayCollection();
  57.     }
  58.     /**
  59.      * @return mixed
  60.      */
  61.     public function getId()
  62.     {
  63.         return $this->id;
  64.     }
  65.     /**
  66.      * @param mixed $id
  67.      */
  68.     public function setId($id)
  69.     {
  70.         $this->id $id;
  71.     }
  72.     /**
  73.      * @return mixed
  74.      */
  75.     public function getCode()
  76.     {
  77.         return $this->code;
  78.     }
  79.     /**
  80.      * @param mixed $code
  81.      */
  82.     public function setCode($code)
  83.     {
  84.         $this->code $code;
  85.     }
  86.     /**
  87.      * @return mixed
  88.      */
  89.     public function getName()
  90.     {
  91.         return $this->name;
  92.     }
  93.     /**
  94.      * @param mixed $name
  95.      */
  96.     public function setName($name)
  97.     {
  98.         $this->name $name;
  99.     }
  100.     /**
  101.      * @return mixed
  102.      */
  103.     public function getPosition()
  104.     {
  105.         return $this->position;
  106.     }
  107.     /**
  108.      * @param mixed $position
  109.      */
  110.     public function setPosition($position)
  111.     {
  112.         $this->position $position;
  113.     }
  114.     /**
  115.      * @return mixed
  116.      */
  117.     public function getUnit()
  118.     {
  119.         return $this->unit;
  120.     }
  121.     /**
  122.      * @param mixed $unit
  123.      */
  124.     public function setUnit($unit)
  125.     {
  126.         $this->unit $unit;
  127.     }
  128.     /**
  129.      * @return mixed
  130.      */
  131.     public function getVariable()
  132.     {
  133.         return $this->variable;
  134.     }
  135.     /**
  136.      * @param mixed $variable
  137.      */
  138.     public function setVariable($variable)
  139.     {
  140.         $this->variable $variable;
  141.     }
  142.     /**
  143.      * @return ArrayCollection
  144.      */
  145.     public function getThermalValues()
  146.     {
  147.         return $this->thermalValues;
  148.     }
  149.     /**
  150.      * @param ArrayCollection $thermalValues
  151.      */
  152.     public function setThermalValues(ArrayCollection $thermalValues)
  153.     {
  154.         $this->thermalValues $thermalValues;
  155.     }
  156.     /**
  157.      * @return mixed
  158.      */
  159.     public function getConstructionElement()
  160.     {
  161.         return $this->constructionElement;
  162.     }
  163.     /**
  164.      * @param mixed $constructionElement
  165.      */
  166.     public function setConstructionElement($constructionElement)
  167.     {
  168.         $this->constructionElement $constructionElement;
  169.     }
  170.     /**
  171.      * {@inheritdoc}
  172.      */
  173.     public function setParentModel($parentModel)
  174.     {
  175.         if (!($parentModel instanceof ConstructionElement)) {
  176.             throw new Exception('invalid parent');
  177.         }
  178.         $this->setConstructionElement($parentModel);
  179.     }
  180. }