src/Mm/Beton/Planungsatlas/AtlasBundle/Entity/Main/RegulationComponent.php line 15

Open in your IDE?
  1. <?php
  2. namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Exception;
  5. /**
  6.  * Class RegulationComponent
  7.  *
  8.  * @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
  9.  * @ORM\Entity
  10.  * @ORM\Table(name="regulation_components")
  11.  */
  12. class RegulationComponent extends AbstractModel implements HasParentModelInterface
  13. {
  14.     /**
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=128, nullable=false)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="ConstructionElement", inversedBy="regulationComponents")
  26.      * @ORM\JoinColumn(name="construction_element_id", referencedColumnName="id", nullable=false)
  27.      */
  28.     private $constructionElement;
  29.     /**
  30.      * @return mixed
  31.      */
  32.     public function getId()
  33.     {
  34.         return $this->id;
  35.     }
  36.     /**
  37.      * @param mixed $id
  38.      */
  39.     public function setId($id)
  40.     {
  41.         $this->id $id;
  42.     }
  43.     /**
  44.      * @return mixed
  45.      */
  46.     public function getName()
  47.     {
  48.         return $this->name;
  49.     }
  50.     /**
  51.      * @param mixed $name
  52.      */
  53.     public function setName($name)
  54.     {
  55.         $this->name $name;
  56.     }
  57.     /**
  58.      * @return mixed
  59.      */
  60.     public function getConstructionElement()
  61.     {
  62.         return $this->constructionElement;
  63.     }
  64.     /**
  65.      * @param mixed $constructionElement
  66.      */
  67.     public function setConstructionElement($constructionElement)
  68.     {
  69.         $this->constructionElement $constructionElement;
  70.     }
  71.     /**
  72.      * {@inheritdoc}
  73.      */
  74.     public function setParentModel($parentModel)
  75.     {
  76.         if (!($parentModel instanceof ConstructionElement)) {
  77.             throw new Exception('invalid parent');
  78.         }
  79.         $this->setConstructionElement($parentModel);
  80.     }
  81. }