src/JuridicusBundle/Entity/ProtokollInfothekPruefung.php line 14

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 Doctrine\Common\Collections\ArrayCollection;
  7. use JF\JuridicusBundle\Entity\Pruefung;
  8. /**
  9. * ProtokollInfothekPruefung
  10. */
  11. class ProtokollInfothekPruefung extends InitModeEntity
  12. {
  13. const CLASSNAME = __CLASS__;
  14. /**
  15. * @var integer
  16. */
  17. private $id;
  18. /**
  19. * @var integer
  20. */
  21. private $mask;
  22. /**
  23. * @var \DateTime
  24. * @Assert\Type(\DateTimeInterface::class)
  25. */
  26. private $datum;
  27. /**
  28. * @var string
  29. * @Assert\NotBlank(groups={"finish"})
  30. * @Assert\Length(max="64")
  31. */
  32. private $ort;
  33. /**
  34. * @var string
  35. * @Assert\Length(max="48")
  36. */
  37. private $wahlfach;
  38. /**
  39. * @var string
  40. * @Assert\Length(max="48")
  41. */
  42. private $aktenvortrag;
  43. /**
  44. * @var integer
  45. * @Assert\Type(type="integer")
  46. * @Assert\Range(min="1",max="2")
  47. * @Assert\NotNull(message="Bitte Examen angeben")
  48. */
  49. private $examen;
  50. /**
  51. * @var boolean
  52. * @Assert\NotNull()
  53. */
  54. private $wahlfachpruefung = false;
  55. /**
  56. * @var boolean
  57. * @Assert\NotNull(message="Bitte Aktiv-Status angeben")
  58. */
  59. private $aktiv = false;
  60. /**
  61. * @var boolean
  62. * @Assert\NotNull(message="Bitte Fertig-Status angeben")
  63. */
  64. private $fertig = false;
  65. /**
  66. * @var \DateTime
  67. */
  68. private $fertig_at = null;
  69. /**
  70. * @var boolean
  71. */
  72. private $pdf_need_update = true;
  73. /**
  74. * @var boolean
  75. */
  76. private $send_last_minute;
  77. /**
  78. * @var \DateTime
  79. * @Assert\Type(\DateTimeInterface::class)
  80. */
  81. private $created_at;
  82. /**
  83. * @var \DateTime
  84. * @Assert\Type(\DateTimeInterface::class)
  85. */
  86. private $updated_at;
  87. /**
  88. * @var \JF\JuridicusBundle\Entity\Pruefung
  89. */
  90. private $pruefung;
  91. /**
  92. * @var \JF\JuridicusBundle\Entity\KundePruefung
  93. */
  94. private $kunde_pruefung;
  95. /**
  96. * @var \JF\JuridicusBundle\Entity\PdfProtokollInfothekPruefung
  97. */
  98. private $pdf_protokoll_infothek_pruefung;
  99. /**
  100. * @var \Doctrine\Common\Collections\Collection
  101. * @Assert\Valid(traverse=true)
  102. */
  103. private $protokoll_infothek_pruefer;
  104. /**
  105. * @var \Doctrine\Common\Collections\Collection
  106. * @Assert\Valid(traverse=true)
  107. */
  108. private $protokoll_infothek_noten;
  109. /**
  110. *
  111. * @var \JF\JuridicusBundle\Entity\ProtokollKlausur
  112. * @Assert\Valid()
  113. */
  114. private $protokoll_klausur;
  115. /**
  116. *
  117. * @var \JF\JuridicusBundle\Entity\ProtokollAktenvortrag
  118. * @Assert\Valid()
  119. */
  120. private $protokoll_aktenvortrag;
  121. /**
  122. * @var \Doctrine\Common\Collections\Collection
  123. */
  124. private $similarities;
  125. /**
  126. * Constructor
  127. */
  128. public function __construct()
  129. {
  130. $this->protokoll_infothek_pruefer = new ArrayCollection();
  131. $this->protokoll_infothek_noten = new ArrayCollection();
  132. $this->similarities = new ArrayCollection();
  133. }
  134. /**
  135. * Get id
  136. *
  137. * @return integer
  138. */
  139. public function getId()
  140. {
  141. return $this->id;
  142. }
  143. /**
  144. * Set datum
  145. *
  146. * @param \DateTime $datum
  147. * @return ProtokollInfothekPruefung
  148. */
  149. public function setDatum(\DateTime $datum = null)
  150. {
  151. $this->datum = $datum;
  152. return $this;
  153. }
  154. /**
  155. * Get datum
  156. *
  157. * @return \DateTime
  158. */
  159. public function getDatum()
  160. {
  161. return $this->datum;
  162. }
  163. /**
  164. * Set ort
  165. *
  166. * @param string $ort
  167. * @return ProtokollInfothekPruefung
  168. */
  169. public function setOrt($ort)
  170. {
  171. $this->ort = $ort;
  172. return $this;
  173. }
  174. /**
  175. * Get ort
  176. *
  177. * @return string
  178. */
  179. public function getOrt()
  180. {
  181. return $this->ort;
  182. }
  183. /**
  184. * Set wahlfach
  185. *
  186. * @param string $wahlfach
  187. * @return ProtokollInfothekPruefung
  188. */
  189. public function setWahlfach($wahlfach)
  190. {
  191. $this->wahlfach = $wahlfach;
  192. return $this;
  193. }
  194. /**
  195. * Get wahlfach
  196. *
  197. * @return string
  198. */
  199. public function getWahlfach()
  200. {
  201. return $this->wahlfach;
  202. }
  203. /**
  204. * Set aktenvortrag
  205. *
  206. * @param string $aktenvortrag
  207. * @return ProtokollInfothekPruefung
  208. */
  209. public function setAktenvortrag($aktenvortrag)
  210. {
  211. $this->aktenvortrag = $aktenvortrag;
  212. if ($this->getProtokollAktenvortrag()) {
  213. $this->getProtokollAktenvortrag()->setFach($aktenvortrag);
  214. }
  215. return $this;
  216. }
  217. /**
  218. * Get aktenvortrag
  219. *
  220. * @return string
  221. */
  222. public function getAktenvortrag()
  223. {
  224. return $this->aktenvortrag;
  225. }
  226. /**
  227. * Set aktiv
  228. *
  229. * @param boolean $aktiv
  230. * @return ProtokollInfothekPruefung
  231. */
  232. public function setAktiv($aktiv = true)
  233. {
  234. $this->aktiv = (bool) $aktiv;
  235. return $this;
  236. }
  237. /**
  238. * Get aktiv
  239. *
  240. * @return boolean
  241. */
  242. public function getAktiv()
  243. {
  244. return $this->aktiv;
  245. }
  246. /**
  247. * Set fertig
  248. *
  249. * @param boolean $fertig
  250. * @return ProtokollInfothekPruefung
  251. */
  252. public function setFertig($fertig = true)
  253. {
  254. $this->fertig = (bool) $fertig;
  255. if ($this->getProtokollAktenvortrag()) {
  256. $this->getProtokollAktenvortrag()->setFertig($fertig);
  257. }
  258. if ($this->getProtokollKlausur()) {
  259. $this->getProtokollKlausur()->setFertig($fertig);
  260. }
  261. return $this;
  262. }
  263. /**
  264. * Get fertig
  265. *
  266. * @return boolean
  267. */
  268. public function getFertig()
  269. {
  270. return $this->fertig;
  271. }
  272. /**
  273. * Set created_at
  274. *
  275. * @param \DateTime $createdAt
  276. * @return ProtokollInfothekPruefung
  277. */
  278. public function setCreatedAt(\DateTime $createdAt = null)
  279. {
  280. $this->created_at = $createdAt;
  281. return $this;
  282. }
  283. /**
  284. * Get created_at
  285. *
  286. * @return \DateTime
  287. */
  288. public function getCreatedAt()
  289. {
  290. return $this->created_at;
  291. }
  292. /**
  293. * Set updated_at
  294. *
  295. * @param \DateTime $updatedAt
  296. * @return ProtokollInfothekPruefung
  297. */
  298. public function setUpdatedAt(\DateTime $updatedAt = null)
  299. {
  300. $this->updated_at = $updatedAt;
  301. return $this;
  302. }
  303. /**
  304. * Get updated_at
  305. *
  306. * @return \DateTime
  307. */
  308. public function getUpdatedAt()
  309. {
  310. return $this->updated_at;
  311. }
  312. /**
  313. * Set kunde_pruefung [INVERSE SIDE]
  314. *
  315. * @param \JF\JuridicusBundle\Entity\KundePruefung $kundePruefung
  316. * @return ProtokollInfothekPruefung
  317. */
  318. public function setKundePruefung(KundePruefung $kundePruefung = null)
  319. {
  320. $this->kunde_pruefung = $kundePruefung;
  321. if ($this->getProtokollAktenvortrag()) {
  322. $this->getProtokollAktenvortrag()->setKundePruefung($kundePruefung);
  323. if ($kundePruefung) {
  324. $this->getProtokollAktenvortrag()->setPruefungsamt($kundePruefung->getPruefungsamt());
  325. }
  326. }
  327. if ($this->getProtokollKlausur()) {
  328. $this->getProtokollKlausur()->setKundePruefung($kundePruefung);
  329. }
  330. return $this;
  331. }
  332. /**
  333. * Get kunde_pruefung
  334. *
  335. * @return \JF\JuridicusBundle\Entity\KundePruefung
  336. */
  337. public function getKundePruefung()
  338. {
  339. return $this->kunde_pruefung;
  340. }
  341. /**
  342. * Add protokoll_infothek_pruefer [INVERSE SIDE]
  343. *
  344. * @param \JF\JuridicusBundle\Entity\ProtokollInfothekPruefer $protokollInfothekPruefer
  345. * @return ProtokollInfothekPruefung
  346. */
  347. public function addProtokollInfothekPruefer(ProtokollInfothekPruefer $protokollInfothekPruefer)
  348. {
  349. $this->protokoll_infothek_pruefer[] = $protokollInfothekPruefer;
  350. $protokollInfothekPruefer->setProtokollInfothekPruefung($this);
  351. return $this;
  352. }
  353. /**
  354. * Remove protokoll_infothek_pruefer [INVERSE SIDE]
  355. *
  356. * @param \JF\JuridicusBundle\Entity\ProtokollInfothekPruefer $protokollInfothekPruefer
  357. */
  358. public function removeProtokollInfothekPruefer(ProtokollInfothekPruefer $protokollInfothekPruefer)
  359. {
  360. $this->protokoll_infothek_pruefer->removeElement($protokollInfothekPruefer);
  361. $protokollInfothekPruefer->setProtokollInfothekPruefung(null);
  362. }
  363. /**
  364. * Get protokoll_infothek_pruefer
  365. *
  366. * @return \Doctrine\Common\Collections\Collection
  367. */
  368. public function getProtokollInfothekPruefer()
  369. {
  370. return $this->protokoll_infothek_pruefer;
  371. }
  372. /**
  373. * Set pdf_protokoll_infothek_pruefung [INVERSE SIDE]
  374. *
  375. * @param \JF\JuridicusBundle\Entity\PdfProtokollInfothekPruefung $pdfProtokollInfothekPruefung
  376. * @return ProtokollInfothekPruefung
  377. */
  378. public function setPdfProtokollInfothekPruefung(PdfProtokollInfothekPruefung $pdfProtokollInfothekPruefung = null)
  379. {
  380. $this->pdf_protokoll_infothek_pruefung = $pdfProtokollInfothekPruefung;
  381. return $this;
  382. }
  383. /**
  384. * Get pdf_protokoll_infothek_pruefung
  385. *
  386. * @return \JF\JuridicusBundle\Entity\PdfProtokollInfothekPruefung
  387. */
  388. public function getPdfProtokollInfothekPruefung()
  389. {
  390. return $this->pdf_protokoll_infothek_pruefung;
  391. }
  392. /**
  393. * Add protokoll_infothek_noten [INVERSE SIDE]
  394. *
  395. * @param \JF\JuridicusBundle\Entity\ProtokollInfothekNoten $protokollInfothekNoten
  396. * @return ProtokollInfothekPruefung
  397. */
  398. public function addProtokollInfothekNoten(ProtokollInfothekNoten $protokollInfothekNoten)
  399. {
  400. $this->protokoll_infothek_noten[] = $protokollInfothekNoten;
  401. $protokollInfothekNoten->setProtokollInfothekPruefung($this);
  402. return $this;
  403. }
  404. /**
  405. * Remove protokoll_infothek_noten [INVERSE SIDE]
  406. *
  407. * @param \JF\JuridicusBundle\Entity\ProtokollInfothekNoten $protokollInfothekNoten
  408. */
  409. public function removeProtokollInfothekNoten(ProtokollInfothekNoten $protokollInfothekNoten)
  410. {
  411. $this->protokoll_infothek_noten->removeElement($protokollInfothekNoten);
  412. $protokollInfothekNoten->setProtokollInfothekPruefung(null);
  413. }
  414. /**
  415. * Get protokoll_infothek_noten
  416. *
  417. * @return \Doctrine\Common\Collections\Collection
  418. */
  419. public function getProtokollInfothekNoten()
  420. {
  421. return $this->protokoll_infothek_noten;
  422. }
  423. /**
  424. * Set pruefung [OWNING SIDE]
  425. *
  426. * @param \JF\JuridicusBundle\Entity\Pruefung $pruefung
  427. * @return ProtokollInfothekPruefung
  428. */
  429. public function setPruefung(Pruefung $pruefung = null)
  430. {
  431. $this->pruefung = $pruefung;
  432. return $this;
  433. }
  434. /**
  435. * Get pruefung
  436. *
  437. * @return \JF\JuridicusBundle\Entity\Pruefung
  438. */
  439. public function getPruefung()
  440. {
  441. return $this->pruefung;
  442. }
  443. /**
  444. * String Representation
  445. *
  446. * @return string
  447. */
  448. public function __toString()
  449. {
  450. if (isset($this->id)) {
  451. return sprintf('Kundenprotokoll #%s', $this->id);
  452. }
  453. return 'Neues Kundenprotokoll';
  454. }
  455. /**
  456. * get Kommission
  457. *
  458. * @param int $sortierung gibt an welches Kommissionsmitglied als Prüfer gekennzeichnet wird
  459. * @return string[]
  460. */
  461. private function getKommission($sortierung)
  462. {
  463. $kommission = array();
  464. foreach ($this->getProtokollInfothekPruefer() as $protokoll_infothek_pruefer) {
  465. $pruefer = $protokoll_infothek_pruefer->getPruefer();
  466. if ($protokoll_infothek_pruefer->getSortierung() == 1) {
  467. if ($protokoll_infothek_pruefer->getSortierung() == $sortierung) {
  468. $kommission[] = sprintf('%s (Vorsitzender + Prüfer)',
  469. $pruefer->getFullTextWithOrt());
  470. } else {
  471. $kommission[] = sprintf('%s (Vorsitzender)',
  472. $pruefer->getFullTextWithOrt());
  473. }
  474. } else if ($protokoll_infothek_pruefer->getSortierung() == $sortierung) {
  475. $kommission[] = sprintf('%s (Prüfer)',
  476. $pruefer->getFullTextWithOrt());
  477. } else {
  478. $kommission[] = $pruefer->getFullTextWithOrt();
  479. }
  480. }
  481. return $kommission;
  482. }
  483. /**
  484. * addBaseToPdf - fügt Basisdaten in die Pdf-Datei ein
  485. *
  486. * @param \TCPDF $pdf
  487. * @param $sortierung gibt an welches Kommissionsmitglied als Prüfer markiert werden soll
  488. */
  489. public function addBaseToPdf(\TCPDF & $pdf, $sortierung)
  490. {
  491. $width = 50;
  492. $nwidth = 10;
  493. if ($this->examen == 1 && ! $this->wahlfachpruefung) {
  494. $pdf->writeHTML('<h3>Protokoll der mündlichen Prüfung zum 1. Staatsexamen</h3>');
  495. } elseif ($this->examen == 1 && $this->wahlfachpruefung) {
  496. $pdf->writeHTML('<h3>Protokoll der mündlichen Wahlfachprüfung zum 1. Staatsexamen</h3>');
  497. } elseif ($this->examen == 2 && ! $this->wahlfachpruefung) {
  498. $pdf->writeHTML('<h3>Protokoll der mündlichen Prüfung zum 2. Staatsexamen</h3>');
  499. } elseif ($this->examen == 2 && $this->wahlfachpruefung) {
  500. $pdf->writeHTML('<h3>Protokoll der mündlichen Wahlfachprüfung zum 2. Staatsexamen</h3>');
  501. }
  502. $pdf->Ln(5);
  503. $pdf->Cell($width, 0, "vom");
  504. $pdf->Cell(0, 0, $this->datum->format('d.m.Y'));
  505. $pdf->Ln();
  506. $pdf->Cell($width, 0, "in");
  507. $pdf->Cell(0, 0, $this->ort);
  508. $pdf->Ln();
  509. if ($this->mask & ProtokollInfothekNoten::OPTION_WAHLFACH && $this->wahlfach) {
  510. $pdf->Cell($width, 0, "Wahlfach");
  511. $pdf->Cell(0, 0, $this->wahlfach, 0, 1);
  512. } else if ($this->mask & ProtokollInfothekNoten::OPTION_VORTRAG && $this->aktenvortrag) {
  513. $pdf->Cell($width, 0, "Rechtsgebiet Aktenvortrag");
  514. $pdf->Cell(0, 0, $this->aktenvortrag, 0, 1);
  515. }
  516. $pdf->Cell($width, 0, 'Kommissionsmitglieder');
  517. foreach ($this->getKommission($sortierung) as $kommission) {
  518. $pdf->Cell(0, 0, $kommission, 0, 2);
  519. }
  520. $pdf->Ln(0);
  521. }
  522. /**
  523. * addNotenToPdf - fügt Notentabelle in Pdf-Datei ein
  524. *
  525. * @param \TCPDF $pdf
  526. */
  527. public function addNotenToPdf(\TCPDF & $pdf)
  528. {
  529. $noten = $this->getProtokollInfothekNoten();
  530. if (!$noten) {
  531. return;
  532. }
  533. // Notentabelle einfügen
  534. $fill = 0;
  535. $pdf->SetFillColor(196);
  536. // Header
  537. $pdf->Cell(50, 6, "Kandidat", 1, 0, 'C', 1);
  538. foreach ($noten as $note) {
  539. $note->createHeaderCell($pdf);
  540. }
  541. $pdf->Ln();
  542. // Body
  543. foreach (ProtokollInfothekNoten::getOptionKeys() as $key) {
  544. if ($this->mask & $key) {
  545. $this->createTableRow($pdf, $key, $fill);
  546. $fill = !$fill;
  547. }
  548. }
  549. }
  550. /**
  551. * createTableRow
  552. *
  553. * Fügt eine Zeile zu einer Notentabelle hinzu
  554. *
  555. * @param \TCPDF $pdf
  556. * @param integer $key Auswahl der Note
  557. * @param boolean $fill
  558. */
  559. private function createTableRow(\TCPDF & $pdf, $key, $fill)
  560. {
  561. // Zeilen-Bezeichnung eintragen
  562. $pdf->SetFillColor(196);
  563. $pdf->Cell(50, 6, ProtokollInfothekNoten::getOptionString($key), 1, 0,
  564. ProtokollInfothekNoten::getAlignment($key), 1);
  565. // Noten eintragen
  566. $pdf->SetFillColor(224, 235, 255);
  567. foreach ($this->getProtokollInfothekNoten() as $note) {
  568. $note->createBodyCell($pdf, $key, $fill);
  569. }
  570. $pdf->Ln();
  571. }
  572. /**
  573. * Set mask
  574. *
  575. * @param integer $mask
  576. * @return ProtokollInfothekPruefung
  577. */
  578. public function setMask($mask)
  579. {
  580. $this->mask = $mask;
  581. return $this;
  582. }
  583. /**
  584. * Get mask
  585. *
  586. * @return integer
  587. */
  588. public function getMask()
  589. {
  590. return $this->mask;
  591. }
  592. /**
  593. *
  594. * @param integer $option
  595. * @return boolean
  596. */
  597. public function hasNotenOption($option)
  598. {
  599. return (bool) ($this->mask & $option);
  600. }
  601. /**
  602. * Set examen
  603. *
  604. * @param integer $examen
  605. * @return ProtokollInfothekPruefung
  606. */
  607. public function setExamen($examen)
  608. {
  609. $this->examen = $examen;
  610. return $this;
  611. }
  612. /**
  613. * Get examen
  614. *
  615. * @return integer
  616. */
  617. public function getExamen()
  618. {
  619. return $this->examen;
  620. }
  621. /**
  622. * Set wahlfachpruefung
  623. *
  624. * @param boolean $wahlfachpruefung
  625. * @return ProtokollInfothekPruefung
  626. */
  627. public function setWahlfachpruefung($wahlfachpruefung)
  628. {
  629. $this->wahlfachpruefung = $wahlfachpruefung;
  630. return $this;
  631. }
  632. /**
  633. * Get wahlfachpruefung
  634. *
  635. * @return boolean
  636. */
  637. public function getWahlfachpruefung()
  638. {
  639. return $this->wahlfachpruefung;
  640. }
  641. /**
  642. * Add similarities
  643. *
  644. * @param \JF\JuridicusBundle\Entity\Similarity $similarities
  645. * @return ProtokollInfothekPruefung
  646. */
  647. public function addSimilaritie(Similarity $similarities)
  648. {
  649. $this->similarities[] = $similarities;
  650. return $this;
  651. }
  652. /**
  653. * Remove similarities
  654. *
  655. * @param \JF\JuridicusBundle\Entity\Similarity $similarities
  656. */
  657. public function removeSimilaritie(Similarity $similarities)
  658. {
  659. $this->similarities->removeElement($similarities);
  660. }
  661. /**
  662. * Get similarities
  663. *
  664. * @return \Doctrine\Common\Collections\Collection
  665. */
  666. public function getSimilarities()
  667. {
  668. return $this->similarities;
  669. }
  670. /**
  671. * Set pdf_need_update
  672. *
  673. * @param boolean $pdfNeedUpdate
  674. * @return ProtokollInfothekPruefung
  675. */
  676. public function setPdfNeedUpdate($pdfNeedUpdate)
  677. {
  678. $this->pdf_need_update = (bool) $pdfNeedUpdate;
  679. return $this;
  680. }
  681. /**
  682. * Get pdf_need_update
  683. *
  684. * @return boolean
  685. */
  686. public function getPdfNeedUpdate()
  687. {
  688. return $this->pdf_need_update;
  689. }
  690. /**
  691. * Set send_last_minute
  692. *
  693. * @param boolean $sendLastMinute
  694. * @return ProtokollInfothekPruefung
  695. */
  696. public function setSendLastMinute($sendLastMinute)
  697. {
  698. $this->send_last_minute = (bool) $sendLastMinute;
  699. return $this;
  700. }
  701. /**
  702. * Get send_last_minute
  703. *
  704. * @return boolean
  705. */
  706. public function getSendLastMinute()
  707. {
  708. return $this->send_last_minute;
  709. }
  710. /**
  711. * Set fertig_at
  712. *
  713. * @param \DateTime $fertigAt
  714. * @return ProtokollInfothekPruefung
  715. */
  716. public function setFertigAt(\DateTime $fertigAt = null)
  717. {
  718. $this->fertig_at = $fertigAt;
  719. return $this;
  720. }
  721. /**
  722. * Get fertig_at
  723. *
  724. * @return \DateTime
  725. */
  726. public function getFertigAt()
  727. {
  728. return $this->fertig_at;
  729. }
  730. /**
  731. *
  732. * @param integer $limit
  733. */
  734. public function expandNoten($limit)
  735. {
  736. $count = $this->getProtokollInfothekNoten()->count();
  737. for ($i = $count + 1; $i <= $limit; $i++) {
  738. $protokoll_infothek_noten = new ProtokollInfothekNoten();
  739. $protokoll_infothek_noten->setKandidatNummer($i);
  740. $this->addProtokollInfothekNoten($protokoll_infothek_noten);
  741. }
  742. }
  743. /**
  744. *
  745. * @param integer $limit
  746. */
  747. public function expandPruefer($limit)
  748. {
  749. $count = $this->getProtokollInfothekPruefer()->count();
  750. for ($i = $count + 1; $i <= $limit; $i++) {
  751. $protokoll_infothek_pruefer = new ProtokollInfothekPruefer();
  752. $protokoll_infothek_pruefer->setSortierung($i);
  753. $this->addProtokollInfothekPruefer($protokoll_infothek_pruefer);
  754. }
  755. }
  756. /**
  757. *
  758. * @param \JF\JuridicusBundle\Entity\PrueferPruefung $prueferPruefung
  759. */
  760. public function addPrueferFromPrueferPruefung(PrueferPruefung $prueferPruefung)
  761. {
  762. $protokoll_infothek_pruefer = new ProtokollInfothekPruefer();
  763. $protokoll_infothek_pruefer->setPruefer($prueferPruefung->getPruefer());
  764. $protokoll_infothek_pruefer->setSortierung($prueferPruefung->getSortierung());
  765. $protokoll_infothek_pruefer->setFach($prueferPruefung->getFach());
  766. $this->addProtokollInfothekPruefer($protokoll_infothek_pruefer);
  767. }
  768. /**
  769. *
  770. * @param \JF\JuridicusBundle\Entity\Pruefung $pruefung
  771. */
  772. public function addPrueferFromPruefung(Pruefung $pruefung)
  773. {
  774. foreach ($pruefung->getPrueferPruefungen() as $prueferPruefung) {
  775. $this->addPrueferFromPrueferPruefung($prueferPruefung);
  776. }
  777. }
  778. /**
  779. * removes empty ProtokollGesetz entities from each item of the protokoll_infothek_pruefer collection.
  780. */
  781. public function removeEmptyProtokollGesetze()
  782. {
  783. foreach ($this->getProtokollInfothekPruefer() as $p) {
  784. $p->removeEmptyProtokollGesetze();
  785. }
  786. }
  787. /**
  788. * Set protokoll_klausur
  789. *
  790. * @param \JF\JuridicusBundle\Entity\ProtokollKlausur $protokollKlausur
  791. * @return ProtokollInfothekPruefung
  792. */
  793. public function setProtokollKlausur(ProtokollKlausur $protokollKlausur = null)
  794. {
  795. $this->protokoll_klausur = $protokollKlausur;
  796. if ($protokollKlausur) {
  797. $protokollKlausur->setProtokollInfothekPruefung($this);
  798. }
  799. return $this;
  800. }
  801. /**
  802. * Get protokoll_klausur
  803. *
  804. * @return \JF\JuridicusBundle\Entity\ProtokollKlausur
  805. */
  806. public function getProtokollKlausur()
  807. {
  808. return $this->protokoll_klausur;
  809. }
  810. /**
  811. * Set protokoll_aktenvortrag
  812. *
  813. * @param \JF\JuridicusBundle\Entity\ProtokollAktenvortrag $protokollAktenvortrag
  814. * @return ProtokollInfothekPruefung
  815. */
  816. public function setProtokollAktenvortrag(ProtokollAktenvortrag $protokollAktenvortrag = null)
  817. {
  818. $this->protokoll_aktenvortrag = $protokollAktenvortrag;
  819. if ($protokollAktenvortrag) {
  820. $protokollAktenvortrag->setProtokollInfothekPruefung($this);
  821. }
  822. return $this;
  823. }
  824. /**
  825. * Get protokoll_aktenvortrag
  826. *
  827. * @return \JF\JuridicusBundle\Entity\ProtokollAktenvortrag
  828. */
  829. public function getProtokollAktenvortrag()
  830. {
  831. return $this->protokoll_aktenvortrag;
  832. }
  833. /**
  834. *
  835. */
  836. public function updateChildData()
  837. {
  838. $buchung = $this->getKundePruefung();
  839. $protokoll_klausur = $this->getProtokollKlausur();
  840. if ($protokoll_klausur) {
  841. $protokoll_klausur->setKundePruefung($buchung);
  842. if ($buchung) {
  843. $protokoll_klausur->setPruefungsamt($buchung->getPruefungsamt());
  844. }
  845. $protokoll_klausur->setFertig($this->getFertig());
  846. }
  847. $protokoll_aktenvortrag = $this->getProtokollAktenvortrag();
  848. if ($protokoll_aktenvortrag) {
  849. $protokoll_aktenvortrag->setKundePruefung($buchung);
  850. if ($buchung) {
  851. $protokoll_aktenvortrag->setPruefungsamt($buchung->getPruefungsamt());
  852. }
  853. $protokoll_aktenvortrag->setFach($this->getAktenvortrag());
  854. $protokoll_aktenvortrag->setFertig($this->getFertig());
  855. }
  856. }
  857. }