<?php
namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
use Doctrine\ORM\Mapping as ORM;
use Exception;
/**
* Class Note
*
* @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
* @ORM\Entity
* @ORM\Table(name="notes")
*/
class Note extends AbstractModel implements HasParentModelInterface
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=1024, nullable=false)
*/
private $value;
/**
* @ORM\ManyToOne(targetEntity="ConstructionElement", inversedBy="notes")
* @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 getValue()
{
return $this->value;
}
/**
* @param mixed $value
*/
public function setValue($value)
{
$this->value = $value;
}
/**
* @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);
}
}