<?php
namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
use Doctrine\ORM\Mapping as ORM;
use Exception;
/**
* Class ThermalValue
*
* @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
* @ORM\Entity
* @ORM\Table(name="thermal_values")
*/
class ThermalValue 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=10, nullable=false)
*/
private $value;
/**
* @ORM\ManyToOne(targetEntity="ThermalParameter", inversedBy="thermalValues")
* @ORM\JoinColumn(name="thermal_parameter_id", referencedColumnName="id", nullable=false)
*/
private $thermalParameter;
/**
* @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 getValue()
{
return $this->value;
}
/**
* @param mixed $value
*/
public function setValue($value)
{
$this->value = $value;
}
/**
* @return mixed
*/
public function getThermalParameter()
{
return $this->thermalParameter;
}
/**
* @param mixed $thermalParameter
*/
public function setThermalParameter($thermalParameter)
{
$this->thermalParameter = $thermalParameter;
}
/**
* {@inheritdoc}
*/
public function setParentModel($parentModel)
{
if (!($parentModel instanceof ThermalParameter)) {
throw new Exception('invalid parent');
}
$this->setThermalParameter($parentModel);
}
}