src/Mm/Beton/Planungsatlas/AtlasBundle/Entity/Main/ConstructionElement.php line 16

Open in your IDE?
  1. <?php
  2. namespace Mm\Beton\Planungsatlas\AtlasBundle\Entity\Main;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Exception;
  6. /**
  7.  * Class ConstructionElement
  8.  *
  9.  * @package Mm\Beton\Planungsatlas\AtlasBundle\Entity
  10.  * @ORM\Entity
  11.  * @ORM\Table(name="construction_elements")
  12.  */
  13. class ConstructionElement extends AbstractModel implements HasParentModelInterface
  14. {
  15.     /**
  16.      * @ORM\Column(type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=20, nullable=false)
  23.      */
  24.     private $code;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=false)
  27.      */
  28.     private $name;
  29.     /**
  30.      * @ORM\Column(type="string", length=10, nullable=false)
  31.      */
  32.     private $hotspot;
  33.     /**
  34.      * @ORM\Column(type="boolean", nullable=false)
  35.      */
  36.     private $new;
  37.     /**
  38.      * @ORM\Column(type="boolean", nullable=false)
  39.      */
  40.     private $ndw false;
  41.     /**
  42.      * @ORM\Column(name="tpc_key_prefix", type="string", length=5, nullable=false)
  43.      */
  44.     private $tpcKeyPrefix;
  45.     /**
  46.      * @ORM\Column(name="count_requests", type="integer")
  47.      */
  48.     private $countRequests 0;
  49.     /**
  50.      * @var ArrayCollection
  51.      * @ORM\OneToMany(targetEntity="Note", mappedBy="constructionElement")
  52.      */
  53.     private $notes;
  54.     /**
  55.      * @var ArrayCollection
  56.      * @ORM\OneToMany(targetEntity="RegulationComponent", mappedBy="constructionElement")
  57.      */
  58.     private $regulationComponents;
  59.     /**
  60.      * @var ArrayCollection
  61.      * @ORM\OneToMany(targetEntity="ThermalParameter", mappedBy="constructionElement")
  62.      */
  63.     private $thermalParameters;
  64.     /**
  65.      * @ORM\ManyToOne(targetEntity="ConstructionType", inversedBy="constructionElements")
  66.      * @ORM\JoinColumn(name="construction_type_id", referencedColumnName="id", nullable=false)
  67.      */
  68.     private $constructionType;
  69.     /**
  70.      * Constructor
  71.      */
  72.     public function __construct()
  73.     {
  74.         $this->notes = new ArrayCollection();
  75.         $this->regulationComponents = new ArrayCollection();
  76.         $this->thermalParameters = new ArrayCollection();
  77.     }
  78.     /**
  79.      * @return mixed
  80.      */
  81.     public function getId()
  82.     {
  83.         return $this->id;
  84.     }
  85.     /**
  86.      * @param mixed $id
  87.      */
  88.     public function setId($id)
  89.     {
  90.         $this->id $id;
  91.     }
  92.     /**
  93.      * @return mixed
  94.      */
  95.     public function getCode()
  96.     {
  97.         return $this->code;
  98.     }
  99.     /**
  100.      * @param mixed $code
  101.      */
  102.     public function setCode($code)
  103.     {
  104.         $this->code $code;
  105.     }
  106.     /**
  107.      * @return mixed
  108.      */
  109.     public function getHotspot()
  110.     {
  111.         return $this->hotspot;
  112.     }
  113.     /**
  114.      * @param mixed $hotspot
  115.      */
  116.     public function setHotspot($hotspot)
  117.     {
  118.         $this->hotspot $hotspot;
  119.     }
  120.     /**
  121.      * @return mixed
  122.      */
  123.     public function getName()
  124.     {
  125.         return $this->name;
  126.     }
  127.     /**
  128.      * @param mixed $name
  129.      */
  130.     public function setName($name)
  131.     {
  132.         $this->name $name;
  133.     }
  134.     /**
  135.      * @return mixed
  136.      */
  137.     public function getNdw()
  138.     {
  139.         return $this->ndw;
  140.     }
  141.     /**
  142.      * @param mixed $ndw
  143.      */
  144.     public function setNdw($ndw)
  145.     {
  146.         $this->ndw $ndw;
  147.     }
  148.     /**
  149.      * @return mixed
  150.      */
  151.     public function getNew()
  152.     {
  153.         return $this->new;
  154.     }
  155.     /**
  156.      * @param mixed $new
  157.      */
  158.     public function setNew($new)
  159.     {
  160.         $this->new $new;
  161.     }
  162.     /**
  163.      * @return mixed
  164.      */
  165.     public function getTpcKeyPrefix()
  166.     {
  167.         return $this->tpcKeyPrefix;
  168.     }
  169.     /**
  170.      * @param mixed $tpcKeyPrefix
  171.      */
  172.     public function setTpcKeyPrefix($tpcKeyPrefix)
  173.     {
  174.         $this->tpcKeyPrefix $tpcKeyPrefix;
  175.     }
  176.     /**
  177.      * @return mixed
  178.      */
  179.     public function getCountRequests()
  180.     {
  181.         return $this->countRequests;
  182.     }
  183.     /**
  184.      * @param mixed $countRequests
  185.      */
  186.     public function setCountRequest($countRequests)
  187.     {
  188.         $this->countRequests $countRequests;
  189.     }
  190.     /**
  191.      * @return ArrayCollection
  192.      */
  193.     public function getNotes()
  194.     {
  195.         return $this->notes;
  196.     }
  197.     /**
  198.      * @param ArrayCollection $notes
  199.      */
  200.     public function setNotes(ArrayCollection $notes)
  201.     {
  202.         $this->notes $notes;
  203.     }
  204.     /**
  205.      * @return ArrayCollection
  206.      */
  207.     public function getRegulationComponents()
  208.     {
  209.         return $this->regulationComponents;
  210.     }
  211.     /**
  212.      * @param ArrayCollection $regulationComponents
  213.      */
  214.     public function setRegulationComponents(ArrayCollection $regulationComponents)
  215.     {
  216.         $this->regulationComponents $regulationComponents;
  217.     }
  218.     /**
  219.      * @return ThermalParameter[]
  220.      */
  221.     public function getThermalParameters()
  222.     {
  223.         return $this->thermalParameters;
  224.     }
  225.     /**
  226.      * @param ArrayCollection $thermalParameters
  227.      */
  228.     public function setThermalParameters(ArrayCollection $thermalParameters)
  229.     {
  230.         $this->thermalParameters $thermalParameters;
  231.     }
  232.     /**
  233.      * @return ConstructionType
  234.      */
  235.     public function getConstructionType()
  236.     {
  237.         return $this->constructionType;
  238.     }
  239.     /**
  240.      * @param mixed $constructionType
  241.      */
  242.     public function setConstructionType($constructionType)
  243.     {
  244.         $this->constructionType $constructionType;
  245.     }
  246.     /**
  247.      * {@inheritdoc}
  248.      */
  249.     public function setParentModel($parentModel)
  250.     {
  251.         if (!($parentModel instanceof ConstructionType)) {
  252.             throw new Exception('invalid parent');
  253.         }
  254.         $this->setConstructionType($parentModel);
  255.     }
  256. }