<?php
namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
use Doctrine\ORM\Mapping as ORM;
use Exception;
/**
* Class RegulationComponent
*
* @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
* @ORM\Entity
* @ORM\Table(name="regulation_components")
*/
class RegulationComponent extends AbstractModel implements HasParentModelInterface
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=128, nullable=false)
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity="ConstructionElement", inversedBy="regulationComponents")
* @ORM\JoinColumn(name="construction_element_id", referencedColumnName="id", nullable=false)
*/
private $constructionElement;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @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);
}
}