src/JuridicusBundle/Entity/Pruefer.php line 15

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\Entity\Pruefung;
  8. /**
  9. * Prüfer
  10. *
  11. * @JfAssert\UniquePruefer
  12. */
  13. class Pruefer extends InitModeEntity
  14. {
  15. const CLASSNAME = __CLASS__;
  16. /**
  17. * @var string[]
  18. */
  19. private static $adel_options = array( 'von der', 'van den', 'vom', 'von', 'van', 'de' );
  20. /**
  21. *
  22. * @return string[]
  23. */
  24. public static function getAdelOptions()
  25. {
  26. return self::$adel_options;
  27. }
  28. /**
  29. * @var integer
  30. */
  31. private $id;
  32. /**
  33. * @var string
  34. * @Assert\Length(max="63")
  35. */
  36. private $vorname;
  37. /**
  38. * @var string
  39. * @Assert\Length(max="12")
  40. */
  41. private $adel;
  42. /**
  43. * @var string
  44. * @Assert\NotBlank
  45. * @Assert\Length(max="63")
  46. */
  47. private $nachname;
  48. /**
  49. * @var string
  50. */
  51. private $email;
  52. /**
  53. * @var string
  54. */
  55. private $anschrift;
  56. /**
  57. * @var string
  58. */
  59. private $strasse;
  60. /**
  61. * @var string
  62. */
  63. private $hausnummer;
  64. /**
  65. * @var string
  66. */
  67. private $plz;
  68. /**
  69. * @var string
  70. */
  71. private $ort;
  72. /**
  73. * @var string
  74. * @Assert\Length(max="255")
  75. */
  76. private $works_at;
  77. /**
  78. * @var string
  79. * @Assert\Length(max="255")
  80. */
  81. private $parsed_from;
  82. /**
  83. * @var string
  84. * @Assert\NotBlank
  85. * @Assert\Length(max="6")
  86. */
  87. private $quelle;
  88. /**
  89. * @var \DateTimeInterface|null
  90. * @Assert\Type(\DateTimeInterface::class)
  91. */
  92. private $created_at;
  93. /**
  94. * @var \Doctrine\Common\Collections\Collection
  95. */
  96. private $aliases;
  97. /**
  98. * @var \JF\JuridicusBundle\Entity\Titel
  99. */
  100. private $titel;
  101. /**
  102. * @var string
  103. */
  104. private $titel_string;
  105. /**
  106. * @var \JF\JuridicusBundle\Entity\Dienststellung
  107. */
  108. private $dienststellung;
  109. /**
  110. * @var string
  111. */
  112. private $dienststellung_string;
  113. /**
  114. * @var \JF\JuridicusBundle\Entity\User
  115. * @Assert\Valid
  116. */
  117. private $creator;
  118. /**
  119. * @var \JF\JuridicusBundle\Entity\Pruefer
  120. * @Assert\Valid
  121. */
  122. private $alias_for;
  123. /**
  124. * @var integer
  125. */
  126. private $ordnr;
  127. /**
  128. * @var string
  129. * @Assert\Length(max="64")
  130. */
  131. private $rechtsgebiete;
  132. /**
  133. * @var \DateTime
  134. */
  135. private $protokoll_datum;
  136. /**
  137. * @var \DateTime
  138. */
  139. private $appeared_first_at;
  140. /**
  141. * @var string
  142. */
  143. private $slug;
  144. /**
  145. * @var string
  146. */
  147. private $full_text = null;
  148. /**
  149. * @var string
  150. */
  151. private $full_text_with_ort = null;
  152. /**
  153. * @var boolean
  154. */
  155. private $pdf_need_update = true;
  156. /**
  157. * @var integer
  158. */
  159. private $pdf_need_update_examen;
  160. /**
  161. * @var \Doctrine\Common\Collections\Collection
  162. */
  163. private $pruefer_pruefungen;
  164. /**
  165. * @var \Doctrine\Common\Collections\Collection
  166. */
  167. private $protokoll_infothek_pruefer;
  168. /**
  169. * @var \Doctrine\Common\Collections\Collection
  170. */
  171. private $protokoll_html;
  172. /**
  173. * @var \Doctrine\Common\Collections\Collection
  174. */
  175. private $emails;
  176. /**
  177. * @var \Doctrine\Common\Collections\Collection
  178. */
  179. private $downloads;
  180. /**
  181. * @var \Doctrine\Common\Collections\Collection
  182. */
  183. private $pruefungsaemter;
  184. /**
  185. * @var \Doctrine\Common\Collections\Collection
  186. */
  187. private $pdf_protokoll_juridicus;
  188. /**
  189. * @var \Doctrine\Common\Collections\Collection
  190. */
  191. private $pdf_protokollmappe_pruefer;
  192. /**
  193. * Constructor
  194. */
  195. public function __construct()
  196. {
  197. $this->aliases = new \Doctrine\Common\Collections\ArrayCollection();
  198. $this->pruefer_pruefungen = new \Doctrine\Common\Collections\ArrayCollection();
  199. $this->protokoll_infothek_pruefer = new \Doctrine\Common\Collections\ArrayCollection();
  200. $this->protokoll_html = new \Doctrine\Common\Collections\ArrayCollection();
  201. $this->emails = new \Doctrine\Common\Collections\ArrayCollection();
  202. $this->downloads = new \Doctrine\Common\Collections\ArrayCollection();
  203. $this->pruefungsaemter = new \Doctrine\Common\Collections\ArrayCollection();
  204. $this->pdf_protokoll_juridicus = new \Doctrine\Common\Collections\ArrayCollection();
  205. $this->pdf_protokollmappe_pruefer = new \Doctrine\Common\Collections\ArrayCollection();
  206. }
  207. /**
  208. * Get id
  209. *
  210. * @return integer
  211. */
  212. public function getId()
  213. {
  214. return $this->id;
  215. }
  216. /**
  217. * Set vorname
  218. *
  219. * @param string $vorname
  220. * @return Pruefer
  221. */
  222. public function setVorname($vorname)
  223. {
  224. $this->vorname = $vorname;
  225. return $this;
  226. }
  227. /**
  228. * Get vorname
  229. *
  230. * @return string
  231. */
  232. public function getVorname()
  233. {
  234. return $this->vorname;
  235. }
  236. /**
  237. * Set nachname
  238. *
  239. * @param string $nachname
  240. * @return Pruefer
  241. */
  242. public function setNachname($nachname)
  243. {
  244. $this->nachname = $nachname;
  245. return $this;
  246. }
  247. /**
  248. * Get nachname
  249. *
  250. * @return string
  251. */
  252. public function getNachname()
  253. {
  254. return $this->nachname;
  255. }
  256. /**
  257. * Set works_at
  258. *
  259. * @param string $worksAt
  260. * @return Pruefer
  261. */
  262. public function setWorksAt($worksAt)
  263. {
  264. $this->works_at = $worksAt;
  265. return $this;
  266. }
  267. /**
  268. * Get works_at
  269. *
  270. * @return string
  271. */
  272. public function getWorksAt()
  273. {
  274. return $this->works_at;
  275. }
  276. /**
  277. * Set parsed_from
  278. *
  279. * @param string $parsedFrom
  280. * @return Pruefer
  281. */
  282. public function setParsedFrom($parsedFrom)
  283. {
  284. $this->parsed_from = $parsedFrom;
  285. return $this;
  286. }
  287. /**
  288. * Get parsed_from
  289. *
  290. * @return string
  291. */
  292. public function getParsedFrom()
  293. {
  294. return $this->parsed_from;
  295. }
  296. /**
  297. * Set quelle
  298. *
  299. * @param string $quelle
  300. * @return Pruefer
  301. */
  302. public function setQuelle($quelle)
  303. {
  304. $this->quelle = $quelle;
  305. return $this;
  306. }
  307. /**
  308. * Get quelle
  309. *
  310. * @return string
  311. */
  312. public function getQuelle()
  313. {
  314. return $this->quelle;
  315. }
  316. /**
  317. * Set created_at
  318. *
  319. * @param \DateTime $createdAt
  320. * @return Pruefer
  321. */
  322. public function setCreatedAt($createdAt)
  323. {
  324. $this->created_at = $createdAt;
  325. return $this;
  326. }
  327. /**
  328. * Get created_at
  329. *
  330. * @return \DateTime
  331. */
  332. public function getCreatedAt()
  333. {
  334. return $this->created_at;
  335. }
  336. /**
  337. * @ORM\PrePersist
  338. */
  339. public function setCreatedAtValue()
  340. {
  341. if (!$this->init_mode AND !isset($this->created_at)) {
  342. $this->setCreatedAt(new \DateTime());
  343. }
  344. }
  345. /**
  346. * Add aliase [INVERSE SIDE]
  347. *
  348. * @param \JF\JuridicusBundle\Entity\Pruefer $aliases
  349. * @return Pruefer
  350. */
  351. public function addAliase(Pruefer $aliases)
  352. {
  353. $this->aliases[] = $aliases;
  354. $aliases->setAliasFor($this);
  355. return $this;
  356. }
  357. /**
  358. * Remove aliases [INVERSE SIDE]
  359. *
  360. * @param \JF\JuridicusBundle\Entity\Pruefer $aliases
  361. */
  362. public function removeAliase(Pruefer $aliases)
  363. {
  364. $this->aliases->removeElement($aliases);
  365. $aliases->setAliasFor(null);
  366. }
  367. /**
  368. * Get aliases
  369. *
  370. * @return \Doctrine\Common\Collections\Collection
  371. */
  372. public function getAliases()
  373. {
  374. return $this->aliases;
  375. }
  376. /**
  377. * Set titel [OWNING SIDE]
  378. *
  379. * @param \JF\JuridicusBundle\Entity\Titel $titel
  380. * @return Pruefer
  381. */
  382. public function setTitel(Titel $titel = null)
  383. {
  384. $this->titel = $titel;
  385. return $this;
  386. }
  387. /**
  388. * Get titel
  389. *
  390. * @return \JF\JuridicusBundle\Entity\Titel
  391. */
  392. public function getTitel()
  393. {
  394. return $this->titel;
  395. }
  396. /**
  397. * Set titelString
  398. *
  399. * @param string
  400. * @return Pruefer
  401. */
  402. public function setTitelString($titelString)
  403. {
  404. $this->titel_string = $titelString;
  405. return $this;
  406. }
  407. /**
  408. * Get titelString
  409. *
  410. * @return string
  411. */
  412. public function getTitelString()
  413. {
  414. return $this->titel_string;
  415. }
  416. /**
  417. * Set creator [OWNING SIDE]
  418. *
  419. * @param \JF\JuridicusBundle\Entity\User $creator
  420. * @return Pruefer
  421. */
  422. public function setCreator(User $creator = null)
  423. {
  424. $this->creator = $creator;
  425. return $this;
  426. }
  427. /**
  428. * Get creator
  429. *
  430. * @return \JF\JuridicusBundle\Entity\User
  431. */
  432. public function getCreator()
  433. {
  434. return $this->creator;
  435. }
  436. /**
  437. * Set alias_for [OWNING SIDE]
  438. *
  439. * @param \JF\JuridicusBundle\Entity\Pruefer $aliasFor
  440. * @return Pruefer
  441. */
  442. public function setAliasFor(Pruefer $aliasFor = null)
  443. {
  444. $this->alias_for = $aliasFor;
  445. return $this;
  446. }
  447. /**
  448. * Get alias_for
  449. *
  450. * @return \JF\JuridicusBundle\Entity\Pruefer
  451. */
  452. public function getAliasFor()
  453. {
  454. return $this->alias_for;
  455. }
  456. /**
  457. * Set slug
  458. *
  459. * @param string $slug
  460. * @return Pruefer
  461. */
  462. public function setSlug($slug)
  463. {
  464. $this->slug = $slug;
  465. return $this;
  466. }
  467. /**
  468. * Get slug
  469. *
  470. * @return string
  471. */
  472. public function getSlug()
  473. {
  474. return $this->slug;
  475. }
  476. /**
  477. * Add emails [INVERSE SIDE]
  478. *
  479. * @param \JF\JuridicusBundle\Entity\Email $emails
  480. * @return Pruefer
  481. */
  482. public function addEmail(Email $emails)
  483. {
  484. $this->emails[] = $emails;
  485. return $this;
  486. }
  487. /**
  488. * Remove emails [INVERSE SIDE]
  489. *
  490. * @param \JF\JuridicusBundle\Entity\Email $emails
  491. */
  492. public function removeEmail(Email $emails)
  493. {
  494. $this->emails->removeElement($emails);
  495. }
  496. /**
  497. * Get emails
  498. *
  499. * @return \Doctrine\Common\Collections\Collection
  500. */
  501. public function getEmails()
  502. {
  503. return $this->emails;
  504. }
  505. /**
  506. * Add downloads [INVERSE SIDE]
  507. *
  508. * @param \JF\JuridicusBundle\Entity\Download $downloads
  509. * @return Pruefer
  510. */
  511. public function addDownload(Download $downloads)
  512. {
  513. $this->downloads[] = $downloads;
  514. return $this;
  515. }
  516. /**
  517. * Remove downloads [INVERSE SIDE]
  518. *
  519. * @param \JF\JuridicusBundle\Entity\Download $downloads
  520. */
  521. public function removeDownload(Download $downloads)
  522. {
  523. $this->downloads->removeElement($downloads);
  524. }
  525. /**
  526. * Get downloads
  527. *
  528. * @return \Doctrine\Common\Collections\Collection
  529. */
  530. public function getDownloads()
  531. {
  532. return $this->downloads;
  533. }
  534. /**
  535. * Set rechtsgebiete
  536. *
  537. * @param string $rechtsgebiete
  538. * @return Pruefer
  539. */
  540. public function setRechtsgebiete($rechtsgebiete)
  541. {
  542. $this->rechtsgebiete = $rechtsgebiete;
  543. return $this;
  544. }
  545. /**
  546. * Get rechtsgebiete
  547. *
  548. * @return string
  549. */
  550. public function getRechtsgebiete()
  551. {
  552. return $this->rechtsgebiete;
  553. }
  554. /**
  555. * Set appeared_first_at
  556. *
  557. * @param \DateTime $appearedFirstAt
  558. * @return Pruefer
  559. */
  560. public function setAppearedFirstAt(\DateTime $appearedFirstAt)
  561. {
  562. $this->appeared_first_at = $appearedFirstAt;
  563. return $this;
  564. }
  565. /**
  566. * Get appeared_first_at
  567. *
  568. * @return \DateTime
  569. */
  570. public function getAppearedFirstAt()
  571. {
  572. return $this->appeared_first_at;
  573. }
  574. /**
  575. * Checks equality
  576. *
  577. * @param Pruefer
  578. * @return boolean
  579. */
  580. public function equals( Pruefer $p )
  581. {
  582. return TRUE
  583. AND $this->vorname == $p->vorname
  584. AND $this->nachname == $p->nachname
  585. AND $this->adel == $p->adel
  586. AND $this->titel->equals( $p->titel )
  587. AND $this->dienststellung->equals( $p->dienststellung )
  588. ;
  589. }
  590. /**
  591. * Set adel
  592. *
  593. * @param string $adel
  594. * @return Pruefer
  595. */
  596. public function setAdel($adel)
  597. {
  598. $this->adel = $adel;
  599. return $this;
  600. }
  601. /**
  602. * Get adel
  603. *
  604. * @return string
  605. */
  606. public function getAdel()
  607. {
  608. return $this->adel;
  609. }
  610. /**
  611. * Set ordnr
  612. *
  613. * @param integer $ordnr
  614. * @return Pruefer
  615. */
  616. public function setOrdnr($ordnr)
  617. {
  618. $this->ordnr = $ordnr;
  619. return $this;
  620. }
  621. /**
  622. * Get ordnr
  623. *
  624. * @return integer
  625. */
  626. public function getOrdnr()
  627. {
  628. return $this->ordnr;
  629. }
  630. /**
  631. * Set protokoll_datum
  632. *
  633. * @param \DateTime $protokollDatum
  634. * @return Pruefer
  635. */
  636. public function setProtokollDatum($protokollDatum)
  637. {
  638. $this->protokoll_datum = $protokollDatum;
  639. return $this;
  640. }
  641. /**
  642. * Get protokoll_datum
  643. *
  644. * @return \DateTime
  645. */
  646. public function getProtokollDatum()
  647. {
  648. return $this->protokoll_datum;
  649. }
  650. /**
  651. * Add pruefer_pruefungen [INVERSE SIDE]
  652. *
  653. * @param \JF\JuridicusBundle\Entity\PrueferPruefung $prueferPruefungen
  654. * @return Pruefer
  655. */
  656. public function addPrueferPruefungen(PrueferPruefung $prueferPruefungen)
  657. {
  658. $this->pruefer_pruefungen[] = $prueferPruefungen;
  659. return $this;
  660. }
  661. /**
  662. * Remove pruefer_pruefungen [INVERSE SIDE]
  663. *
  664. * @param \JF\JuridicusBundle\Entity\PrueferPruefung $prueferPruefungen
  665. */
  666. public function removePrueferPruefungen(PrueferPruefung $prueferPruefungen)
  667. {
  668. $this->pruefer_pruefungen->removeElement($prueferPruefungen);
  669. }
  670. /**
  671. * Get pruefer_pruefungen
  672. *
  673. * @return \Doctrine\Common\Collections\Collection
  674. */
  675. public function getPrueferPruefungen()
  676. {
  677. return $this->pruefer_pruefungen;
  678. }
  679. /**
  680. * Add protokoll_infothek_pruefer [INVERSE SIDE]
  681. *
  682. * @param \JF\JuridicusBundle\Entity\ProtokollInfothekPruefer $protokollInfothekPruefer
  683. * @return Pruefer
  684. */
  685. public function addProtokollInfothekPruefer(ProtokollInfothekPruefer $protokollInfothekPruefer)
  686. {
  687. $this->protokoll_infothek_pruefer[] = $protokollInfothekPruefer;
  688. return $this;
  689. }
  690. /**
  691. * Remove protokoll_infothek_pruefer [INVERSE SIDE]
  692. *
  693. * @param \JF\JuridicusBundle\Entity\ProtokollInfothekPruefer $protokollInfothekPruefer
  694. */
  695. public function removeProtokollInfothekPruefer(ProtokollInfothekPruefer $protokollInfothekPruefer)
  696. {
  697. $this->protokoll_infothek_pruefer->removeElement($protokollInfothekPruefer);
  698. }
  699. /**
  700. * Get protokoll_infothek_pruefer
  701. *
  702. * @return \Doctrine\Common\Collections\Collection
  703. */
  704. public function getProtokollInfothekPruefer()
  705. {
  706. return $this->protokoll_infothek_pruefer;
  707. }
  708. /**
  709. * Set dienststellung [OWNING SIDE]
  710. *
  711. * @param \JF\JuridicusBundle\Entity\Dienststellung $dienststellung
  712. * @return Pruefer
  713. */
  714. public function setDienststellung(Dienststellung $dienststellung = null)
  715. {
  716. $this->dienststellung = $dienststellung;
  717. return $this;
  718. }
  719. /**
  720. * Get dienststellung
  721. *
  722. * @return \JF\JuridicusBundle\Entity\Dienststellung
  723. */
  724. public function getDienststellung()
  725. {
  726. return $this->dienststellung;
  727. }
  728. /**
  729. * Set dienststellungString
  730. *
  731. * @param string $dienststellungString
  732. * @return Pruefer
  733. */
  734. public function setDienststellungString($dienststellungString)
  735. {
  736. $this->dienststellung_string = $dienststellungString;
  737. return $this;
  738. }
  739. /**
  740. * Get dienststellungString
  741. *
  742. * @return string
  743. */
  744. public function getDienststellungString()
  745. {
  746. return $this->dienststellung_string;
  747. }
  748. /**
  749. * Add pruefungsaemter
  750. *
  751. * @param \JF\JuridicusBundle\Entity\Pruefungsamt $pruefungsaemter
  752. * @return Pruefer
  753. */
  754. public function addPruefungsaemter(Pruefungsamt $pruefungsaemter)
  755. {
  756. $this->pruefungsaemter[] = $pruefungsaemter;
  757. $pruefungsaemter->addPruefer($this);
  758. return $this;
  759. }
  760. /**
  761. * Remove pruefungsaemter
  762. *
  763. * @param \JF\JuridicusBundle\Entity\Pruefungsamt $pruefungsaemter
  764. */
  765. public function removePruefungsaemter(Pruefungsamt $pruefungsaemter)
  766. {
  767. $this->pruefungsaemter->removeElement($pruefungsaemter);
  768. $pruefungsaemter->removePruefer($this);
  769. }
  770. /**
  771. * Get pruefungsaemter
  772. *
  773. * @return \Doctrine\Common\Collections\Collection
  774. */
  775. public function getPruefungsaemter()
  776. {
  777. return $this->pruefungsaemter;
  778. }
  779. /**
  780. * Add protokoll_html [INVERSE SIDE]
  781. *
  782. * @param \JF\JuridicusBundle\Entity\ProtokollHtml $protokollHtml
  783. * @return Pruefer
  784. */
  785. public function addProtokollHtml(ProtokollHtml $protokollHtml)
  786. {
  787. $this->protokoll_html[] = $protokollHtml;
  788. return $this;
  789. }
  790. /**
  791. * Remove protokoll_html [INVERSE SIDE]
  792. *
  793. * @param \JF\JuridicusBundle\Entity\ProtokollHtml $protokollHtml
  794. */
  795. public function removeProtokollHtml(ProtokollHtml $protokollHtml)
  796. {
  797. $this->protokoll_html->removeElement($protokollHtml);
  798. }
  799. /**
  800. * Get protokoll_html
  801. *
  802. * @return \Doctrine\Common\Collections\Collection
  803. */
  804. public function getProtokollHtml()
  805. {
  806. return $this->protokoll_html;
  807. }
  808. /**
  809. * Add pdf_protokoll_juridicus [INVERSE SIDE]
  810. *
  811. * @param \JF\JuridicusBundle\Entity\PdfProtokollJuridicus $pdfProtokollJuridicus
  812. * @return Pruefer
  813. */
  814. public function addPdfProtokollJuridicu(PdfProtokollJuridicus $pdfProtokollJuridicus)
  815. {
  816. $this->pdf_protokoll_juridicus[] = $pdfProtokollJuridicus;
  817. return $this;
  818. }
  819. /**
  820. * Remove pdf_protokoll_juridicus [INVERSE SIDE]
  821. *
  822. * @param \JF\JuridicusBundle\Entity\PdfProtokollJuridicus $pdfProtokollJuridicus
  823. */
  824. public function removePdfProtokollJuridicu(PdfProtokollJuridicus $pdfProtokollJuridicus)
  825. {
  826. $this->pdf_protokoll_juridicus->removeElement($pdfProtokollJuridicus);
  827. }
  828. /**
  829. * Get pdf_protokoll_juridicus
  830. *
  831. * @return \Doctrine\Common\Collections\Collection
  832. */
  833. public function getPdfProtokollJuridicus()
  834. {
  835. return $this->pdf_protokoll_juridicus;
  836. }
  837. /**
  838. * Add pdf_protokollmappe_pruefer [INVERSE SIDE]
  839. *
  840. * @param \JF\JuridicusBundle\Entity\PdfProtokollmappePruefer $pdfProtokollmappePruefer
  841. * @return Pruefer
  842. */
  843. public function addPdfProtokollmappePruefer(PdfProtokollmappePruefer $pdfProtokollmappePruefer)
  844. {
  845. $this->pdf_protokollmappe_pruefer[] = $pdfProtokollmappePruefer;
  846. return $this;
  847. }
  848. /**
  849. * Remove pdf_protokollmappe_pruefer [INVERSE SIDE]
  850. *
  851. * @param \JF\JuridicusBundle\Entity\PdfProtokollmappePruefer $pdfProtokollmappePruefer
  852. */
  853. public function removePdfProtokollmappePruefer(PdfProtokollmappePruefer $pdfProtokollmappePruefer)
  854. {
  855. $this->pdf_protokollmappe_pruefer->removeElement($pdfProtokollmappePruefer);
  856. }
  857. /**
  858. * Get pdf_protokollmappe_pruefer
  859. *
  860. * @return \Doctrine\Common\Collections\Collection
  861. */
  862. public function getPdfProtokollmappePruefer()
  863. {
  864. return $this->pdf_protokollmappe_pruefer;
  865. }
  866. /**
  867. * Get different representations for SEO
  868. * @return string[]
  869. */
  870. public function getSeoVariants()
  871. {
  872. $return = array();
  873. if (empty($this->adel)) {
  874. $return['adel_name'] = $this->nachname;
  875. } else {
  876. $return['adel_name'] = sprintf('%s %s', $this->adel, $this->nachname);
  877. }
  878. if (empty($this->vorname)) {
  879. $return['vorname_adel_name'] = $return['adel_name'];
  880. $return['adel_name,_vorname'] = $return['adel_name'];
  881. } else {
  882. $return['vorname_adel_name'] = sprintf('%s %s', $this->vorname,
  883. $return['adel_name']);
  884. $return['adel_name,_vorname'] = sprintf('%s, %s',
  885. $return['adel_name'], $this->vorname);
  886. }
  887. if (empty($this->titel)) {
  888. $return['titel_vorname_adel_name'] = $return['vorname_adel_name'];
  889. } else {
  890. $return['titel_vorname_adel_name'] = sprintf('%s %s',
  891. $this->titel->getVisibleName(), $return['vorname_adel_name']);
  892. }
  893. if (empty($this->dienststellung)) {
  894. $return['titel_vorname_adel_name,_dienststellung'] = $return['titel_vorname_adel_name'];
  895. $return['titel_vorname_adel_name_dienststellung'] = $return['titel_vorname_adel_name'];
  896. } else {
  897. $return['titel_vorname_adel_name,_dienststellung'] = sprintf('%s, %s',
  898. $return['titel_vorname_adel_name'],
  899. $this->dienststellung->getVisibleName()
  900. );
  901. $return['titel_vorname_adel_name_dienststellung'] = sprintf('%s %s',
  902. $return['titel_vorname_adel_name'],
  903. $this->dienststellung->getVisibleName()
  904. );
  905. }
  906. return $return;
  907. }
  908. /**
  909. *
  910. * @return string
  911. */
  912. public function getCssClass()
  913. {
  914. if ($this->getPdfProtokollJuridicus()->count() > 0) {
  915. return 'protokoll';
  916. } else {
  917. return 'no-protokoll';
  918. }
  919. }
  920. /**
  921. *
  922. * @return string
  923. */
  924. public function getFullText()
  925. {
  926. if (isset($this->full_text)) {
  927. return $this->full_text;
  928. }
  929. $this->full_text = '';
  930. if (!empty($this->nachname)) {
  931. $this->full_text .= $this->nachname;
  932. }
  933. $this->full_text = $this->nachname;
  934. if (!empty($this->vorname)) {
  935. $this->full_text .= ', ' . $this->vorname;
  936. if (!empty($this->adel)) {
  937. $this->full_text .= ' ' . $this->adel;
  938. }
  939. } else if (!empty($this->adel)) {
  940. $this->full_text .= ', ' . $this->adel;
  941. }
  942. if (isset($this->titel)) {
  943. $this->full_text .= ', ' . $this->titel->getVisibleName();
  944. }
  945. if (isset($this->dienststellung)) {
  946. $this->full_text .= ', ' . $this->dienststellung->getVisibleName();
  947. }
  948. return $this->full_text;
  949. }
  950. /**
  951. *
  952. * @return string
  953. */
  954. public function getFullTextWithOrt()
  955. {
  956. if (isset($this->full_text_with_ort)) {
  957. return $this->full_text_with_ort;
  958. }
  959. $this->full_text_with_ort = $this->nachname;
  960. if (isset($this->adel)) {
  961. $this->full_text_with_ort = sprintf('%s %s', $this->adel, $this->full_text_with_ort);
  962. }
  963. if (isset($this->vorname)) {
  964. $this->full_text_with_ort = sprintf('%s %s', $this->vorname, $this->full_text_with_ort);
  965. }
  966. if (isset($this->titel)) {
  967. $this->full_text_with_ort = sprintf('%s %s', $this->titel->getVisibleName(), $this->full_text_with_ort);
  968. }
  969. if (isset($this->dienststellung)) {
  970. $this->full_text_with_ort = sprintf('%s %s', $this->dienststellung->getVisibleName(), $this->full_text_with_ort);
  971. }
  972. if (isset($this->works_at)) {
  973. $this->full_text_with_ort = sprintf('%s, %s', $this->full_text_with_ort, $this->works_at);
  974. }
  975. return $this->full_text_with_ort;
  976. }
  977. /**
  978. * getOldDyn - dynamisch erzeugter Link des alten Systems
  979. *
  980. * @return string
  981. */
  982. public function getOldDyn()
  983. {
  984. $href = sprintf( '%s_%s_%s_%s_%s_pruefer_protokolle_pruefung_jura_examen',
  985. $this->getNachname(),
  986. $this->getVorname() ? $this->getVorname() : '',
  987. $this->getAdel() ? $this->getAdel() : '',
  988. $this->getTitel() ? $this->getTitel()->getName() : '',
  989. $this->getDienststellung() ? $this->getDienststellung()->getName() : ''
  990. );
  991. $remove = array('.',' ','´','`','\'');
  992. return str_replace($remove, '-', $href).'.php';
  993. }
  994. /**
  995. * getProtokollCountForExamen
  996. *
  997. * @param integer examen
  998. * @return integer
  999. */
  1000. public function getProtokollCountForExamen($examen)
  1001. {
  1002. $alias = $this->getAliasFor();
  1003. if ($alias) {
  1004. return $alias->getProtokollCountForExamen($examen);
  1005. }
  1006. foreach($this->getPdfProtokollmappePruefer() as $mappe) {
  1007. if ($mappe->getExamen() == $examen) {
  1008. return $mappe->getAnzahlProtokolle();
  1009. }
  1010. }
  1011. return 0;
  1012. }
  1013. /**
  1014. * getProtokollCount
  1015. *
  1016. * @return array
  1017. */
  1018. public function getProtokollCount()
  1019. {
  1020. $alias = $this->getAliasFor();
  1021. if ($alias) {
  1022. return $alias->getProtokollCount();
  1023. }
  1024. $return = array('gesamt' => 0);
  1025. foreach(Pruefung::getTypKeys() as $typ) {
  1026. $return[$typ] = 0;
  1027. }
  1028. foreach($this->getPdfProtokollmappePruefer() as $mappe) {
  1029. $return[$mappe->getExamen()] = $mappe->getAnzahlProtokolle();
  1030. $return['gesamt'] += $mappe->getAnzahlProtokolle();
  1031. }
  1032. return $return;
  1033. }
  1034. /**
  1035. * String Representation
  1036. *
  1037. * @return string
  1038. */
  1039. public function __toString()
  1040. {
  1041. $p = $this->getFullText();
  1042. return isset($p) ? $p : 'Neuer Prüfer';
  1043. }
  1044. /**
  1045. * Set pdf_need_update
  1046. *
  1047. * @param boolean $pdfNeedUpdate
  1048. * @return Pruefer
  1049. */
  1050. public function setPdfNeedUpdate($pdfNeedUpdate)
  1051. {
  1052. $this->pdf_need_update = $pdfNeedUpdate;
  1053. return $this;
  1054. }
  1055. /**
  1056. * Get pdf_need_update
  1057. *
  1058. * @return boolean
  1059. */
  1060. public function getPdfNeedUpdate()
  1061. {
  1062. return $this->pdf_need_update;
  1063. }
  1064. /**
  1065. * Set pdf_need_update_examen
  1066. *
  1067. * @param integer $pdfNeedUpdateExamen
  1068. * @return Pruefer
  1069. */
  1070. public function setPdfNeedUpdateExamen($pdfNeedUpdateExamen)
  1071. {
  1072. $this->pdf_need_update_examen = $pdfNeedUpdateExamen;
  1073. return $this;
  1074. }
  1075. /**
  1076. * Get pdf_need_update_examen
  1077. *
  1078. * @return integer
  1079. */
  1080. public function getPdfNeedUpdateExamen()
  1081. {
  1082. return $this->pdf_need_update_examen;
  1083. }
  1084. // NEU 27.02.2023
  1085. /**
  1086. * Set email
  1087. *
  1088. * @param string $email
  1089. * @return Pruefer
  1090. */
  1091. public function setEmail($email)
  1092. {
  1093. $this->email = $email;
  1094. return $this;
  1095. }
  1096. /**
  1097. * Get email
  1098. *
  1099. * @return string
  1100. */
  1101. public function getEmail()
  1102. {
  1103. return $this->email;
  1104. }
  1105. /**
  1106. * Set anschrift
  1107. *
  1108. * @param string $strasse
  1109. * @return Pruefer
  1110. */
  1111. public function setAnschrift($anschrift)
  1112. {
  1113. $this->anschrift = $anschrift;
  1114. return $this;
  1115. }
  1116. /**
  1117. * Get anschrift
  1118. *
  1119. * @return string
  1120. */
  1121. public function getAnschrift()
  1122. {
  1123. return $this->anschrift;
  1124. }
  1125. /**
  1126. * Set strasse
  1127. *
  1128. * @param string $strasse
  1129. * @return Pruefer
  1130. */
  1131. public function setStrasse($strasse)
  1132. {
  1133. $this->strasse = $strasse;
  1134. return $this;
  1135. }
  1136. /**
  1137. * Get strasse
  1138. *
  1139. * @return string
  1140. */
  1141. public function getStrasse()
  1142. {
  1143. return $this->strasse;
  1144. }
  1145. /**
  1146. * Set hausnummer
  1147. *
  1148. * @param string $hausnummer
  1149. * @return Pruefer
  1150. */
  1151. public function setHausnummer($hausnummer)
  1152. {
  1153. $this->hausnummer = $hausnummer;
  1154. return $this;
  1155. }
  1156. /**
  1157. * Get hausnummer
  1158. *
  1159. * @return string
  1160. */
  1161. public function getHausnummer()
  1162. {
  1163. return $this->hausnummer;
  1164. }
  1165. /**
  1166. * Set ort
  1167. *
  1168. * @param string $ort
  1169. * @return Kunde
  1170. */
  1171. public function setOrt($ort)
  1172. {
  1173. $this->ort = $ort;
  1174. return $this;
  1175. }
  1176. /**
  1177. * Get ort
  1178. *
  1179. * @return string
  1180. */
  1181. public function getOrt()
  1182. {
  1183. return $this->ort;
  1184. }
  1185. /**
  1186. * Set plz
  1187. *
  1188. * @param string $plz
  1189. * @return Kunde
  1190. */
  1191. public function setPlz($plz)
  1192. {
  1193. $this->plz = $plz;
  1194. return $this;
  1195. }
  1196. /**
  1197. * Get plz
  1198. *
  1199. * @return string
  1200. */
  1201. public function getPlz()
  1202. {
  1203. return $this->plz;
  1204. }
  1205. }