src/JuridicusBundle/Entity/ProtokollInfothekPruefer.php line 20

Open in your IDE?
  1. <?php
  2. namespace JF\JuridicusBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use JF\JuridicusBundle\Validator\Constraints as JfAssert;
  7. use JF\JuridicusBundle\Utils\Juridicus;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use JF\JuridicusBundle\Repository\ProtokollInfothekPrueferRepository;
  10. /**
  11.  * ProtokollInfothekPruefer
  12.  *
  13.  * @UniqueEntity(fields={"protokoll_infothek_pruefung","pruefer"}, message="Ein Prüfer kann nur einmal an der Prüfung teilnehmen.")
  14.  */
  15.  
  16. #[ORM\Entity(repositoryClassProtokollInfothekPrueferRepository::class)]
  17. class ProtokollInfothekPruefer extends InitModeEntity
  18. {
  19.     const CLASSNAME __CLASS__;
  20.     /**
  21.      * @var integer
  22.      */
  23.     private $id;
  24.     /**
  25.      * @var integer
  26.      */
  27.     private $sortierung 0;
  28.     /**
  29.      * @var string
  30.      * @Assert\Length(max="18")
  31.      */
  32.     private $fach;
  33.     /**
  34.      * @var integer
  35.      * @Assert\Type(type="integer")
  36.      * @Assert\Range(min="1", max="2047", minMessage="Es muss mindestens ein Wert ausgewählt werden.",groups={"finish"})
  37.      */
  38.     private $person_verhalten;
  39.     /**
  40.      * @var array
  41.      */
  42.     private static $person_verhalten_options = array(
  43.         => 'freundlich',
  44.         => 'humorvoll',
  45.         => 'neutral',
  46.         => 'distanziert',
  47.         16 => 'wohlwollend',
  48.         32 => 'beruhigend',
  49.         64 => 'nervös',
  50.         128 => 'unsicher',
  51.         256 => 'ungeduldig',
  52.         512 => 'ernst',
  53.         1024 => 'sachlich'
  54.     );
  55.     /**
  56.      * @return array
  57.      */
  58.     public static function getPersonVerhaltenOptions()
  59.     {
  60.         return self::$person_verhalten_options;
  61.     }
  62.     /**
  63.      * @var integer
  64.      * @Assert\NotNull(groups={"finish"}, message="Es muss ein Wert ausgewählt werden.")
  65.      * @Assert\Choice(callback = "getPersonFuehrtKeys", groups={"finish"})
  66.      */
  67.     private $person_fuehrt;
  68.     /**
  69.      * @var array
  70.      */
  71.     private static $person_fuehrt_options = array(
  72.         => 'gut',
  73.         => 'schlecht'
  74.     );
  75.     /**
  76.      * @return string
  77.      * @throws \OutOfBoundsException
  78.      */
  79.     public function getPersonFuehrtString()
  80.     {
  81.         if (!isset($this->person_fuehrt)) {
  82.             return '';
  83.         } else if (isset(self::$person_fuehrt_options[$this->person_fuehrt])) {
  84.             return self::$person_fuehrt_options[$this->person_fuehrt];
  85.         } else {
  86.             throw new \OutOfBoundsException(sprintf('%s, Ungültiger Index %d'__METHOD__$this->person_fuehrt));
  87.         }
  88.     }
  89.     /**
  90.      * @return array
  91.      */
  92.     public static function getPersonFuehrtKeys()
  93.     {
  94.         return array_keys(self::$person_fuehrt_options);
  95.     }
  96.     /**
  97.      * @return array
  98.      */
  99.     public static function getPersonFuehrtOptions()
  100.     {
  101.         return self::$person_fuehrt_options;
  102.     }
  103.     /**
  104.      * @var integer
  105.      * @Assert\NotNull(groups={"finish"}, message="Es muss ein Wert ausgewählt werden.")
  106.      * @Assert\Choice(callback="getPersonNotengebungKeys",groups={"finish"})
  107.      */
  108.     private $person_notengebung;
  109.     /**
  110.      * @return string
  111.      * @throws \OutOfBoundsException
  112.      */
  113.     public function getPersonNotengebungString()
  114.     {
  115.         if (!isset($this->person_notengebung)) {
  116.             return '';
  117.         } else if (isset(self::$person_notengebung_options[$this->person_notengebung])) {
  118.             return self::$person_notengebung_options[$this->person_notengebung];
  119.         } else {
  120.             throw new \OutOfBoundsException(sprintf('%s, Ungültiger Index %d'__METHOD__$this->person_notengebung));
  121.         }
  122.     }
  123.     /**
  124.      * @var array
  125.      */
  126.     private static $person_notengebung_options = array(
  127.         => 'wohlwollend',
  128.         => 'korrekt',
  129.         => 'streng'
  130.     );
  131.     /**
  132.      * @return array
  133.      */
  134.     public static function getPersonNotengebungKeys()
  135.     {
  136.         return array_keys(self::$person_notengebung_options);
  137.     }
  138.     /**
  139.      * @return array
  140.      */
  141.     public static function getPersonNotengebungOptions()
  142.     {
  143.         return self::$person_notengebung_options;
  144.     }
  145.     /**
  146.      * @var integer
  147.      * @Assert\NotNull(groups={"finish"}, message="Es muss ein Wert ausgewählt werden.")
  148.      * @Assert\Range(min="1", max="5", groups={"finish"})
  149.      */
  150.     private $person_eindruck;
  151.     /**
  152.      * @var string
  153.      * @Assert\NotBlank(groups={"finish"})
  154.      * @JfAssert\StripMinLength(min="500", groups={"finish"})
  155.      */
  156.     private $person_lang;
  157.     /**
  158.      * @var integer
  159.      * @Assert\Range(min="0", max="3", groups={"finish"})
  160.      */
  161.     private $sache_stoff;
  162.     /**
  163.      * @var array
  164.      */
  165.     private static $sache_stoff_options = array(
  166.         => "protokollfest",
  167.         => "aktuelle Fälle"
  168.     );
  169.     /**
  170.      * @return array
  171.      */
  172.     public static function getSacheStoffOptions()
  173.     {
  174.         return self::$sache_stoff_options;
  175.     }
  176.     /**
  177.      * @var string
  178.      * @Assert\NotBlank(groups={"finish"})
  179.      */
  180.     private $sache_themen;
  181.     /**
  182.      * @var integer
  183.      * @Assert\NotNull(groups={"finish"})
  184.      * @Assert\Range(min="1", minMessage="Es muss mindestens ein Wert ausgewählt werden.", groups={"finish"})
  185.      */
  186.     private $sache_gespraech;
  187.     /**
  188.      * @var array
  189.      */
  190.     private static $sache_gespraech_options = array(
  191.         => 'Frage-Antwort',
  192.         => 'Diskussion',
  193.         => 'hält Reihenfolge ein',
  194.         => 'lässt Meldungen zu',
  195.         16 => 'Intensivbefragung Einzelner',
  196.         32 => 'verfolgt Zwischenthemen',
  197.         64 => 'hart am Fall',
  198.         128 => 'lässt sich ablenken',
  199.         256 => 'Fragestellung klar'
  200.     );
  201.     /**
  202.      * @return array
  203.      */
  204.     public static function getSacheGespraechOptions()
  205.     {
  206.         return self::$sache_gespraech_options;
  207.     }
  208.     /**
  209.      * @var string
  210.      * @Assert\NotBlank(groups={"finish"})
  211.      * @JfAssert\StripMinLength(min="1500", groups={"finish"})
  212.      */
  213.     private $sache_lang;
  214.     /**
  215.      * @var \JF\JuridicusBundle\Entity\Pruefer
  216.      * @Assert\NotNull(message="Bitte Prüfer angeben",groups={"finish"})
  217.      */
  218.     private $pruefer;
  219.     /**
  220.      * @var \JF\JuridicusBundle\Entity\PdfProtokollInfothekPruefer
  221.      */
  222.     private $pdf_protokoll_infothek_pruefer;
  223.     /**
  224.      * @var \JF\JuridicusBundle\Entity\ProtokollInfothekPruefung
  225.      */
  226.     private $protokoll_infothek_pruefung;
  227.     /**
  228.      * @var \Doctrine\Common\Collections\Collection
  229.      */
  230.     private $similarities;
  231.     /**
  232.      * @var \Doctrine\Common\Collections\Collection
  233.      */
  234.     private $emails;
  235.     /**
  236.      *
  237.      * @var \Doctrine\Common\Collections\Collection
  238.      * @Assert\Count(
  239.      *      max = "5",
  240.      *      maxMessage = "Es dürfen höchstens {{ limit }} Gesetze angegeben werden.",
  241.      *      groups = {"admin"}
  242.      * )
  243.      * @Assert\Valid()
  244.      */
  245.     private $protokoll_gesetze;
  246.     /**
  247.      * @Assert\IsFalse(
  248.      *      message = "Es muss mindestens ein Paragraph angegeben werden.",
  249.      *      groups = {"finish"}
  250.      * )
  251.      * changedFrom Assert\False
  252.      */
  253.     public function isProtokollGesetzeEmpty()
  254.     {
  255.         foreach ($this->getProtokollGesetze() as $pg) {
  256.             if (!$pg->isEmpty()) {
  257.                 return false;
  258.             }
  259.         }
  260.         return true;
  261.     }
  262.     /**
  263.      * Get id
  264.      *
  265.      * @return integer
  266.      */
  267.     public function getId()
  268.     {
  269.         return $this->id;
  270.     }
  271.     /**
  272.      * Set sortierung
  273.      *
  274.      * @param integer $sortierung
  275.      * @return ProtokollInfothekPruefer
  276.      */
  277.     public function setSortierung($sortierung)
  278.     {
  279.         $this->sortierung $sortierung;
  280.         return $this;
  281.     }
  282.     /**
  283.      * Get sortierung
  284.      *
  285.      * @return integer
  286.      */
  287.     public function getSortierung()
  288.     {
  289.         return $this->sortierung;
  290.     }
  291.     /**
  292.      * Set fach
  293.      *
  294.      * @param string $fach
  295.      * @return ProtokollInfothekPruefer
  296.      */
  297.     public function setFach($fach)
  298.     {
  299.         $this->fach PrueferPruefung::unifyFach($fach);
  300.         return $this;
  301.     }
  302.     /**
  303.      * Get fach
  304.      *
  305.      * @return string
  306.      */
  307.     public function getFach()
  308.     {
  309.         return $this->fach;
  310.     }
  311.     /**
  312.      * Set person_verhalten
  313.      *
  314.      * @param integer $personVerhalten
  315.      * @return ProtokollInfothekPruefer
  316.      */
  317.     public function setPersonVerhalten($personVerhalten)
  318.     {
  319.         $this->person_verhalten $personVerhalten;
  320.         return $this;
  321.     }
  322.     /**
  323.      * Get person_verhalten
  324.      *
  325.      * @return integer
  326.      */
  327.     public function getPersonVerhalten()
  328.     {
  329.         return $this->person_verhalten;
  330.     }
  331.     /**
  332.      * Set person_fuehrt
  333.      *
  334.      * @param integer $personFuehrt
  335.      * @return ProtokollInfothekPruefer
  336.      */
  337.     public function setPersonFuehrt($personFuehrt)
  338.     {
  339.         $this->person_fuehrt $personFuehrt;
  340.         return $this;
  341.     }
  342.     /**
  343.      * Get person_fuehrt
  344.      *
  345.      * @return integer
  346.      */
  347.     public function getPersonFuehrt()
  348.     {
  349.         return $this->person_fuehrt;
  350.     }
  351.     /**
  352.      * Set person_notengebung
  353.      *
  354.      * @param integer $personNotengebung
  355.      * @return ProtokollInfothekPruefer
  356.      */
  357.     public function setPersonNotengebung($personNotengebung)
  358.     {
  359.         $this->person_notengebung $personNotengebung;
  360.         return $this;
  361.     }
  362.     /**
  363.      * Get person_notengebung
  364.      *
  365.      * @return integer
  366.      */
  367.     public function getPersonNotengebung()
  368.     {
  369.         return $this->person_notengebung;
  370.     }
  371.     /**
  372.      * Set person_eindruck
  373.      *
  374.      * @param integer $personEindruck
  375.      * @return ProtokollInfothekPruefer
  376.      */
  377.     public function setPersonEindruck($personEindruck)
  378.     {
  379.         $this->person_eindruck $personEindruck;
  380.         return $this;
  381.     }
  382.     /**
  383.      * Get person_eindruck
  384.      *
  385.      * @return integer
  386.      */
  387.     public function getPersonEindruck()
  388.     {
  389.         return $this->person_eindruck;
  390.     }
  391.     /**
  392.      * Set person_lang
  393.      *
  394.      * @param string $personLang
  395.      * @return ProtokollInfothekPruefer
  396.      */
  397.     public function setPersonLang($personLang)
  398.     {
  399.         $this->person_lang $personLang;
  400.         return $this;
  401.     }
  402.     /**
  403.      * Get person_lang
  404.      *
  405.      * @return string
  406.      */
  407.     public function getPersonLang()
  408.     {
  409.         return $this->person_lang;
  410.     }
  411.     /**
  412.      * Set sache_stoff
  413.      *
  414.      * @param integer $sacheStoff
  415.      * @return ProtokollInfothekPruefer
  416.      */
  417.     public function setSacheStoff($sacheStoff)
  418.     {
  419.         $this->sache_stoff $sacheStoff;
  420.         return $this;
  421.     }
  422.     /**
  423.      * Get sache_stoff
  424.      *
  425.      * @return integer
  426.      */
  427.     public function getSacheStoff()
  428.     {
  429.         return $this->sache_stoff;
  430.     }
  431.     /**
  432.      * Set sache_themen
  433.      *
  434.      * @param string $sacheThemen
  435.      * @return ProtokollInfothekPruefer
  436.      */
  437.     public function setSacheThemen($sacheThemen)
  438.     {
  439.         $this->sache_themen $sacheThemen;
  440.         return $this;
  441.     }
  442.     /**
  443.      * Get sache_themen
  444.      *
  445.      * @return string
  446.      */
  447.     public function getSacheThemen()
  448.     {
  449.         return $this->sache_themen;
  450.     }
  451.     /**
  452.      * Set sache_gespraech
  453.      *
  454.      * @param integer $sacheGespraech
  455.      * @return ProtokollInfothekPruefer
  456.      */
  457.     public function setSacheGespraech($sacheGespraech)
  458.     {
  459.         $this->sache_gespraech $sacheGespraech;
  460.         return $this;
  461.     }
  462.     /**
  463.      * Get sache_gespraech
  464.      *
  465.      * @return integer
  466.      */
  467.     public function getSacheGespraech()
  468.     {
  469.         return $this->sache_gespraech;
  470.     }
  471.     /**
  472.      * Set sache_lang
  473.      *
  474.      * @param string $sacheLang
  475.      * @return ProtokollInfothekPruefer
  476.      */
  477.     public function setSacheLang($sacheLang)
  478.     {
  479.         $this->sache_lang $sacheLang;
  480.         return $this;
  481.     }
  482.     /**
  483.      * Get sache_lang
  484.      *
  485.      * @return string
  486.      */
  487.     public function getSacheLang()
  488.     {
  489.         return $this->sache_lang;
  490.     }
  491.     /**
  492.      * Set pruefer [OWNING SIDE]
  493.      *
  494.      * @param \JF\JuridicusBundle\Entity\Pruefer $pruefer
  495.      * @return ProtokollInfothekPruefer
  496.      */
  497.     public function setPruefer(Pruefer $pruefer null)
  498.     {
  499.         $this->pruefer $pruefer;
  500.         return $this;
  501.     }
  502.     /**
  503.      * Get pruefer
  504.      *
  505.      * @return \JF\JuridicusBundle\Entity\Pruefer
  506.      */
  507.     public function getPruefer()
  508.     {
  509.         return $this->pruefer;
  510.     }
  511.     /**
  512.      * Set protokoll_infothek_pruefung [OWNING SIDE]
  513.      *
  514.      * @param \JF\JuridicusBundle\Entity\ProtokollInfothekPruefung $protokollInfothekPruefung
  515.      * @return ProtokollInfothekPruefer
  516.      */
  517.     public function setProtokollInfothekPruefung(ProtokollInfothekPruefung $protokollInfothekPruefung null)
  518.     {
  519.         $this->protokoll_infothek_pruefung $protokollInfothekPruefung;
  520.         return $this;
  521.     }
  522.     /**
  523.      * Get protokoll_infothek_pruefung
  524.      *
  525.      * @return \JF\JuridicusBundle\Entity\ProtokollInfothekPruefung
  526.      */
  527.     public function getProtokollInfothekPruefung()
  528.     {
  529.         return $this->protokoll_infothek_pruefung;
  530.     }
  531.     /**
  532.      * Set pdf_protokoll_infothek_pruefer [INVERSE SIDE]
  533.      *
  534.      * @param \JF\JuridicusBundle\Entity\PdfProtokollInfothekPruefer $pdfProtokollInfothekPruefer
  535.      * @return ProtokollInfothekPruefer
  536.      */
  537.     public function setPdfProtokollInfothekPruefer(PdfProtokollInfothekPruefer $pdfProtokollInfothekPruefer null)
  538.     {
  539.         $this->pdf_protokoll_infothek_pruefer $pdfProtokollInfothekPruefer;
  540.         return $this;
  541.     }
  542.     /**
  543.      * Get pdf_protokoll_infothek_pruefer
  544.      *
  545.      * @return \JF\JuridicusBundle\Entity\PdfProtokollInfothekPruefer
  546.      */
  547.     public function getPdfProtokollInfothekPruefer()
  548.     {
  549.         return $this->pdf_protokoll_infothek_pruefer;
  550.     }
  551.     /**
  552.      * String Representation
  553.      *
  554.      * @return string
  555.      */
  556.     public function __toString()
  557.     {
  558.         return sprintf('Protokoll Infothek Prüfer #%s'$this->id);
  559.     }
  560.     /**
  561.      * addToPdf
  562.      *
  563.      * @param \TCPDF $pdf
  564.      */
  565.     public function addToPdf(\TCPDF $pdf)
  566.     {
  567.         $width 50;
  568.         $nwidth 10;
  569.         $protokoll_infothek_pruefung $this->getProtokollInfothekPruefung();
  570.         // Basisdaten einfügen
  571.         $protokoll_infothek_pruefung->addBaseToPdf($pdf$this->sortierung);
  572.         $pdf->Cell($width0"Prüfungsfach (-fächer)");
  573.         $pdf->Cell(00$this->fach01);
  574.         $pdf->Ln(5);
  575.         $pdf->writeHTML("<h3>Die Prüfung im Einzelnen</h3>");
  576.         $pdf->Ln(5);
  577.         // Notentabelle einfügen
  578.         $protokoll_infothek_pruefung->addNotenToPdf($pdf);
  579.         $pdf->Ln(5);
  580.         $pdf->writeHTML("<h3>Zur Person:</h3>");
  581.         $pdf->Ln(5);
  582.         $pdf->Cell($nwidth0'1.');
  583.         $pdf->Cell($width0'Prüfungsverhalten');
  584.         foreach (Juridicus::pick($this->person_verhaltenself::$person_verhalten_options) AS $option) {
  585.             $pdf->Cell(00$option02);
  586.         }
  587.         $pdf->Ln(0);
  588.         if (isset($this->person_fuehrt)) {
  589.             $pdf->Cell($nwidth0'');
  590.             $pdf->Cell($width0'führt');
  591.             $pdf->Cell(00$this->getPersonFuehrtString(), 01);
  592.         }
  593.         if (isset($this->person_notengebung)) {
  594.             $pdf->Cell($nwidth0'2.');
  595.             $pdf->Cell($width0'Notengebung');
  596.             $pdf->Cell(00$this->getPersonNotengebungString(), 01);
  597.         }
  598.         if (isset($this->person_eindruck)) {
  599.             $pdf->Cell($nwidth0'3.');
  600.             $pdf->Cell($width0'Gesamteindruck');
  601.             $pdf->Cell(00sprintf('%s (1 = ideal ... 5 = äußerst unangenehm)'$this->person_eindruck), 01);
  602.         }
  603.         $pdf->Ln(5);
  604.         $pdf->writeHTML("<h3>Zur Sache:</h3>");
  605.         $pdf->Ln(5);
  606.         $pdf->Cell($nwidth0'1.');
  607.         if (!empty($this->sache_stoff)) {
  608.             $selected Juridicus::pick($this->sache_stoffself::$sache_stoff_options);
  609.             $pdf->Cell($width0'Prüfungsstoff');
  610.             $pdf->Cell(00implode(", "$selected), 01);
  611.             $pdf->Cell($nwidth0'');
  612.         }
  613.         $pdf->Cell($width0'Prüfungsthemen');
  614.         $pdf->writeHTMLCell(00''''$this->sache_themen01);
  615.         $paragraphen = array();
  616.         foreach($this->getProtokollGesetze() as $protokoll_gesetz) {
  617.             /* @var $protokoll_gesetz \JF\JuridicusBundle\Entity\ProtokollGesetz */
  618.             $paragraphen[] = sprintf('<a href="%s">%s</a>',
  619.                 $protokoll_gesetz->getAbsoluteLink(),
  620.                 $protokoll_gesetz->getKurzbezeichnung()
  621.             );
  622.         }
  623.         if (!empty($paragraphen)) {
  624.                $pdf->Cell($nwidth0'');
  625.             $pdf->Cell($width0'Paragraphen');
  626.                $pdf->writeHTMLCell(00''''\implode(', '$paragraphen), 01);
  627.         }
  628.         $pdf->Cell($nwidth0'2.');
  629.         $pdf->Cell($width0'Prüfungsgespräch');
  630.         foreach (Juridicus::pick($this->sache_gespraechself::$sache_gespraech_options) AS $option)     {
  631.             $pdf->Cell(00$option02);
  632.         }
  633.         $pdf->Ln(5);
  634.         $pdf->writeHTML("<h3>Zur Person des Prüfers (ausführlich)</h3>");
  635.         $pdf->Ln(5);
  636.         $pdf->writeHTML($this->person_lang);
  637.         $pdf->Ln(5);
  638.         $pdf->writeHTML("<h3>Zur Sache (ausführlich)</h3>");
  639.         $pdf->Ln(5);
  640.         $pdf->writeHTML($this->sache_lang);
  641.         $pdf->Ln(5);
  642.         $pdf->lastPage();
  643.     }
  644.     /**
  645.      * Konstructor.
  646.      */
  647.     public function __construct()
  648.     {
  649.         $this->similarities = new ArrayCollection();
  650.         $this->emails = new ArrayCollection();
  651.         $this->protokoll_gesetze = new ArrayCollection();
  652.     }
  653.     /**
  654.      * Add similarities
  655.      *
  656.      * @param \JF\JuridicusBundle\Entity\Similarity $similarities
  657.      * @return ProtokollInfothekPruefer
  658.      */
  659.     public function addSimilaritie(Similarity $similarities)
  660.     {
  661.         $this->similarities[] = $similarities;
  662.         return $this;
  663.     }
  664.     /**
  665.      * Remove similarities
  666.      *
  667.      * @param \JF\JuridicusBundle\Entity\Similarity $similarities
  668.      */
  669.     public function removeSimilaritie(Similarity $similarities)
  670.     {
  671.         $this->similarities->removeElement($similarities);
  672.     }
  673.     /**
  674.      * Get similarities
  675.      *
  676.      * @return \Doctrine\Common\Collections\Collection
  677.      */
  678.     public function getSimilarities()
  679.     {
  680.         return $this->similarities;
  681.     }
  682.     /**
  683.      * Add emails
  684.      *
  685.      * @param \JF\JuridicusBundle\Entity\Email $emails
  686.      * @return ProtokollInfothekPruefer
  687.      */
  688.     public function addEmail(Email $emails)
  689.     {
  690.         $this->emails[] = $emails;
  691.         return $this;
  692.     }
  693.     /**
  694.      * Remove emails
  695.      *
  696.      * @param \JF\JuridicusBundle\Entity\Email $emails
  697.      */
  698.     public function removeEmail(Email $emails)
  699.     {
  700.         $this->emails->removeElement($emails);
  701.     }
  702.     /**
  703.      * Get emails
  704.      *
  705.      * @return \Doctrine\Common\Collections\Collection
  706.      */
  707.     public function getEmails()
  708.     {
  709.         return $this->emails;
  710.     }
  711.     /**
  712.      * Add protokoll_gesetze
  713.      *
  714.      * @param \JF\JuridicusBundle\Entity\ProtokollGesetz $protokollGesetz
  715.      * @return ProtokollInfothekPruefer
  716.      */
  717.     public function addProtokollGesetze(ProtokollGesetz $protokollGesetz)
  718.     {
  719.         $this->protokoll_gesetze[] = $protokollGesetz;
  720.         $protokollGesetz->setProtokollInfothekPruefer($this);
  721.         return $this;
  722.     }
  723.     /**
  724.      * Remove protokoll_gesetze
  725.      *
  726.      * @param \JF\JuridicusBundle\Entity\ProtokollGesetz $protokollGesetz
  727.      */
  728.     public function removeProtokollGesetze(ProtokollGesetz $protokollGesetz)
  729.     {
  730.         $this->protokoll_gesetze->removeElement($protokollGesetz);
  731.     }
  732.     /**
  733.      * Get protokoll_gesetze
  734.      *
  735.      * @return \Doctrine\Common\Collections\Collection
  736.      */
  737.     public function getProtokollGesetze()
  738.     {
  739.         return $this->protokoll_gesetze;
  740.     }
  741.     /**
  742.      *
  743.      * @param integer $limit
  744.      */
  745.     public function expandProtokollGesetze($limit 5)
  746.     {
  747.         $pg_count $this->getProtokollGesetze()->count();
  748.         for ($i $pg_count 1$i <= $limit$i++) {
  749.             $pg = new ProtokollGesetz();
  750.             //  $pg->setSortierung($i);
  751.             $this->addProtokollGesetze($pg);
  752.         }
  753.     }
  754.     /**
  755.      *
  756.      */
  757.     public function removeEmptyProtokollGesetze()
  758.     {
  759.         foreach($this->getProtokollGesetze() as $pg) {
  760.             if ($pg->isEmpty()) {
  761.                 $this->removeProtokollGesetze($pg);
  762.             }
  763.         }
  764.     }
  765. }