<?php
namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Exception;
/**
* Class ConstructionElement
*
* @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
* @ORM\Entity
* @ORM\Table(name="construction_elements")
*/
class ConstructionElement extends AbstractModel implements HasParentModelInterface
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=20, nullable=false)
*/
private $code;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private $name;
/**
* @ORM\Column(type="string", length=10, nullable=false)
*/
private $hotspot;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $new;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $ndw = false;
/**
* @ORM\Column(name="tpc_key_prefix", type="string", length=5, nullable=false)
*/
private $tpcKeyPrefix;
/**
* @ORM\Column(name="count_requests", type="integer")
*/
private $countRequests = 0;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="Note", mappedBy="constructionElement")
*/
private $notes;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="RegulationComponent", mappedBy="constructionElement")
*/
private $regulationComponents;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="ThermalParameter", mappedBy="constructionElement")
*/
private $thermalParameters;
/**
* @ORM\ManyToOne(targetEntity="ConstructionType", inversedBy="constructionElements")
* @ORM\JoinColumn(name="construction_type_id", referencedColumnName="id", nullable=false)
*/
private $constructionType;
/**
* Constructor
*/
public function __construct()
{
$this->notes = new ArrayCollection();
$this->regulationComponents = new ArrayCollection();
$this->thermalParameters = 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 getHotspot()
{
return $this->hotspot;
}
/**
* @param mixed $hotspot
*/
public function setHotspot($hotspot)
{
$this->hotspot = $hotspot;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getNdw()
{
return $this->ndw;
}
/**
* @param mixed $ndw
*/
public function setNdw($ndw)
{
$this->ndw = $ndw;
}
/**
* @return mixed
*/
public function getNew()
{
return $this->new;
}
/**
* @param mixed $new
*/
public function setNew($new)
{
$this->new = $new;
}
/**
* @return mixed
*/
public function getTpcKeyPrefix()
{
return $this->tpcKeyPrefix;
}
/**
* @param mixed $tpcKeyPrefix
*/
public function setTpcKeyPrefix($tpcKeyPrefix)
{
$this->tpcKeyPrefix = $tpcKeyPrefix;
}
/**
* @return mixed
*/
public function getCountRequests()
{
return $this->countRequests;
}
/**
* @param mixed $countRequests
*/
public function setCountRequest($countRequests)
{
$this->countRequests = $countRequests;
}
/**
* @return ArrayCollection
*/
public function getNotes()
{
return $this->notes;
}
/**
* @param ArrayCollection $notes
*/
public function setNotes(ArrayCollection $notes)
{
$this->notes = $notes;
}
/**
* @return ArrayCollection
*/
public function getRegulationComponents()
{
return $this->regulationComponents;
}
/**
* @param ArrayCollection $regulationComponents
*/
public function setRegulationComponents(ArrayCollection $regulationComponents)
{
$this->regulationComponents = $regulationComponents;
}
/**
* @return ThermalParameter[]
*/
public function getThermalParameters()
{
return $this->thermalParameters;
}
/**
* @param ArrayCollection $thermalParameters
*/
public function setThermalParameters(ArrayCollection $thermalParameters)
{
$this->thermalParameters = $thermalParameters;
}
/**
* @return ConstructionType
*/
public function getConstructionType()
{
return $this->constructionType;
}
/**
* @param mixed $constructionType
*/
public function setConstructionType($constructionType)
{
$this->constructionType = $constructionType;
}
/**
* {@inheritdoc}
*/
public function setParentModel($parentModel)
{
if (!($parentModel instanceof ConstructionType)) {
throw new Exception('invalid parent');
}
$this->setConstructionType($parentModel);
}
}