<?php
namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Exception;
/**
* Class ThermalParameter
*
* @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
* @ORM\Entity
* @ORM\Table(name="thermal_parameters")
*/
class ThermalParameter extends AbstractModel implements HasParentModelInterface
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=5, nullable=false)
*/
private $code;
/**
* @ORM\Column(type="string", length=128, nullable=false)
*/
private $name;
/**
* @ORM\Column(type="string", length=5, nullable=true)
*/
private $position;
/**
* @ORM\Column(type="string", length=5, nullable=false)
*/
private $variable;
/**
* @ORM\Column(type="string", length=7, nullable=false)
*/
private $unit;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="ThermalValue", mappedBy="thermalParameter")
*/
private $thermalValues;
/**
* @ORM\ManyToOne(targetEntity="ConstructionElement", inversedBy="thermalParameters")
* @ORM\JoinColumn(name="construction_element_id", referencedColumnName="id", nullable=false)
*/
private $constructionElement;
/**
* Constructor
*/
public function __construct()
{
$this->thermalValues = new ArrayCollection();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getCode()
{
return $this->code;
}
/**
* @param mixed $code
*/
public function setCode($code)
{
$this->code = $code;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getPosition()
{
return $this->position;
}
/**
* @param mixed $position
*/
public function setPosition($position)
{
$this->position = $position;
}
/**
* @return mixed
*/
public function getUnit()
{
return $this->unit;
}
/**
* @param mixed $unit
*/
public function setUnit($unit)
{
$this->unit = $unit;
}
/**
* @return mixed
*/
public function getVariable()
{
return $this->variable;
}
/**
* @param mixed $variable
*/
public function setVariable($variable)
{
$this->variable = $variable;
}
/**
* @return ArrayCollection
*/
public function getThermalValues()
{
return $this->thermalValues;
}
/**
* @param ArrayCollection $thermalValues
*/
public function setThermalValues(ArrayCollection $thermalValues)
{
$this->thermalValues = $thermalValues;
}
/**
* @return mixed
*/
public function getConstructionElement()
{
return $this->constructionElement;
}
/**
* @param mixed $constructionElement
*/
public function setConstructionElement($constructionElement)
{
$this->constructionElement = $constructionElement;
}
/**
* {@inheritdoc}
*/
public function setParentModel($parentModel)
{
if (!($parentModel instanceof ConstructionElement)) {
throw new Exception('invalid parent');
}
$this->setConstructionElement($parentModel);
}
}