src/JuridicusBundle/Entity/KundePruefung.php line 13

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. /**
  7.  * KundePruefung
  8.  * @UniqueEntity(fields={"kunde","pruefung"}, message="Diese Prüfung wurde bereits gebucht.")
  9.  * @UniqueEntity(fields={"kunde","datum_pruefung"}, message="An diesem Tag wurde bereits eine Prüfung gebucht.")
  10.  */
  11. class KundePruefung
  12. {
  13.     const CLASSNAME __CLASS__;
  14.     /**
  15.      * @var integer
  16.      */
  17.     private $id;
  18.     /**
  19.      * @var \DateTime
  20.      * @Assert\Type(\DateTimeInterface::class)
  21.      */
  22.     private $datum_pruefung;
  23.     /**
  24.      * @var \DateTime
  25.      * @Assert\Type(\DateTimeInterface::class)
  26.      */
  27.     private $datum_buchung;
  28.     /**
  29.      * @var float
  30.      */
  31.     private $betrag_gebuehr;
  32.     /**
  33.      * @var boolean
  34.      * @Assert\NotNull
  35.      */
  36.     private $gebuehr_bezahlt false;
  37.     /**
  38.      * @var float
  39.      */
  40.     private $betrag_strafe;
  41.     /**
  42.      * @var boolean
  43.      * @Assert\NotNull
  44.      */
  45.     private $strafe_bezahlt false;
  46.     /**
  47.      * @var boolean
  48.      * @Assert\NotNull
  49.      */
  50.     private $protokollpflicht true;
  51.     /**
  52.      * @var boolean
  53.      * @Assert\NotNull
  54.      */
  55.     private $klausurprotokollpflicht true;
  56.     /**
  57.      * @var boolean
  58.        * @Assert\NotNull
  59.      */
  60.     private $belohnung false;
  61.     /**
  62.      * @var boolean
  63.      * @Assert\NotNull
  64.      */
  65.     private $belohnung_bezahlt false;
  66.     /**
  67.      * @var string
  68.      */
  69.     private $notiz;
  70.     /**
  71.      * @var \JF\JuridicusBundle\Entity\ProtokollInfothekPruefung
  72.      * @Assert\Valid
  73.      */
  74.     private $protokoll_infothek_pruefung;
  75.     /**
  76.      * @var \JF\JuridicusBundle\Entity\Kunde
  77.      * @Assert\Valid
  78.      */
  79.     private $kunde;
  80.     /**
  81.      * @var \JF\JuridicusBundle\Entity\Pruefung
  82.      * @Assert\Valid
  83.      */
  84.     private $pruefung;
  85.     /**
  86.      * @var \JF\JuridicusBundle\Entity\Nachweis
  87.      * @Assert\Valid
  88.      */
  89.     private $nachweis;
  90.     /**
  91.      * @var \Doctrine\Common\Collections\Collection
  92.      */
  93.     private $emails;
  94.     /**
  95.      * @var \Doctrine\Common\Collections\Collection
  96.      */
  97.     private $downloads;
  98.     /**
  99.      * @var \Doctrine\Common\Collections\Collection
  100.      */
  101.     private $rechnungen;
  102.     /**
  103.      * @var \JF\JuridicusBundle\Entity\Gebuehr
  104.      * @Assert\Valid
  105.      */
  106.     private $gebuehr;
  107.     /**
  108.      * @var \JF\JuridicusBundle\Entity\Gebuehr
  109.      * @Assert\Valid
  110.      */
  111.     private $strafe;
  112.     /**
  113.      * @var \JF\JuridicusBundle\Entity\Pruefungsamt
  114.      * @Assert\NotNull
  115.      */
  116.     private $pruefungsamt;
  117.     /**
  118.      * @var boolean
  119.      */
  120.     private $abgemahnt false;
  121.     /**
  122.      * @var \JF\JuridicusBundle\Entity\Gutschein
  123.      * @Assert\Valid
  124.      */
  125.     private $gutschein;
  126.     /**
  127.      * @var \Doctrine\Common\Collections\Collection
  128.      */
  129.     private $shoutbox_messages;
  130.     /**
  131.      * @var \JF\JuridicusBundle\Entity\ProtokollKlausur
  132.      */
  133.     private $protokoll_klausur;
  134.     /**
  135.      *
  136.      * @var \JF\JuridicusBundle\Entity\ProtokollAktenvortrag
  137.      */
  138.     private $protokoll_aktenvortrag;
  139.     /**
  140.      * @var boolean
  141.      */
  142.     private $pflicht_facebook_post false;
  143.     /**
  144.      * @var boolean
  145.      */
  146.     private $wrote_facebook_post false;
  147.     /**
  148.      * isInvalidGutschein
  149.      *
  150.      * @return boolean
  151.      *
  152.      * @Assert\IsFalse(groups={"gutschein"}, message = "Der Gutscheincode gilt nicht für Protokolle.")
  153.      * changedFrom Assert\False
  154.      */
  155.     public function isInvalidGutschein()
  156.     {
  157.         $gutschein $this->getGutschein();
  158.         if (!$gutschein || !$gutschein->getId()) {
  159.             return false;
  160.         }
  161.         return $gutschein->getValidZeitschrift() !== null;
  162.     }
  163.     /**
  164.      * Constructor
  165.      */
  166.     public function __construct()
  167.     {
  168.         $this->emails = new \Doctrine\Common\Collections\ArrayCollection();
  169.         $this->downloads = new \Doctrine\Common\Collections\ArrayCollection();
  170.         $this->rechnungen = new \Doctrine\Common\Collections\ArrayCollection();
  171.         $this->shoutbox_messages = new \Doctrine\Common\Collections\ArrayCollection();
  172.     }
  173.     /**
  174.      * Get id
  175.      *
  176.      * @return integer
  177.      */
  178.     public function getId()
  179.     {
  180.         return $this->id;
  181.     }
  182.     /**
  183.      * Set gebuehr_bezahlt
  184.      *
  185.      * @param boolean $gebuehrBezahlt
  186.      * @return KundePruefung
  187.      */
  188.     public function setGebuehrBezahlt($gebuehrBezahlt)
  189.     {
  190.         $this->gebuehr_bezahlt = (bool) $gebuehrBezahlt;
  191.         return $this;
  192.     }
  193.     /**
  194.      * Get gebuehr_bezahlt
  195.      *
  196.      * @return boolean
  197.      */
  198.     public function getGebuehrBezahlt()
  199.     {
  200.         return $this->gebuehr_bezahlt;
  201.     }
  202.     /**
  203.      * Set strafe_bezahlt
  204.      *
  205.      * @param boolean $strafeBezahlt
  206.      * @return KundePruefung
  207.      */
  208.     public function setStrafeBezahlt($strafeBezahlt)
  209.     {
  210.         $this->strafe_bezahlt = (bool) $strafeBezahlt;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Get strafe_bezahlt
  215.      *
  216.      * @return boolean
  217.      */
  218.     public function getStrafeBezahlt()
  219.     {
  220.         return $this->strafe_bezahlt;
  221.     }
  222.     /**
  223.      * Set protokollpflicht
  224.      *
  225.      * @param boolean $protokollpflicht
  226.      * @return KundePruefung
  227.      */
  228.     public function setProtokollpflicht($protokollpflicht)
  229.     {
  230.         $this->protokollpflicht = (bool) $protokollpflicht;
  231.         return $this;
  232.     }
  233.     /**
  234.      * Get protokollpflicht
  235.      *
  236.      * @return boolean
  237.      */
  238.     public function getProtokollpflicht()
  239.     {
  240.         return $this->protokollpflicht;
  241.     }
  242.     /**
  243.      * Set protokoll_infothek_pruefung [OWNING SIDE]
  244.      *
  245.      * @param \JF\JuridicusBundle\Entity\ProtokollInfothekPruefung $protokollInfothekPruefung
  246.      * @return KundePruefung
  247.      */
  248.     public function setProtokollInfothekPruefung(ProtokollInfothekPruefung $protokollInfothekPruefung null)
  249.     {
  250.         $this->protokoll_infothek_pruefung $protokollInfothekPruefung;
  251.         return $this;
  252.     }
  253.     /**
  254.      * Get protokoll_infothek_pruefung
  255.      *
  256.      * @return \JF\JuridicusBundle\Entity\ProtokollInfothekPruefung
  257.      */
  258.     public function getProtokollInfothekPruefung()
  259.     {
  260.         return $this->protokoll_infothek_pruefung;
  261.     }
  262.     /**
  263.      * Set nachweis [OWNING SIDE]
  264.      *
  265.      * @param \JF\JuridicusBundle\Entity\Nachweis $nachweis
  266.      * @return KundePruefung
  267.      */
  268.     public function setNachweis(Nachweis $nachweis null)
  269.     {
  270.         $this->nachweis $nachweis;
  271.         return $this;
  272.     }
  273.     /**
  274.      * Get nachweis
  275.      *
  276.      * @return \JF\JuridicusBundle\Entity\Nachweis
  277.      */
  278.     public function getNachweis()
  279.     {
  280.         return $this->nachweis;
  281.     }
  282.     /**
  283.      * Set kunde [OWNING SIDE]
  284.      *
  285.      * @param \JF\JuridicusBundle\Entity\Kunde $kunde
  286.      * @return KundePruefung
  287.      */
  288.     public function setKunde(Kunde $kunde null)
  289.     {
  290.         $this->kunde $kunde;
  291.         return $this;
  292.     }
  293.     /**
  294.      * Get kunde
  295.      *
  296.      * @return \JF\JuridicusBundle\Entity\Kunde
  297.      */
  298.     public function getKunde()
  299.     {
  300.         return $this->kunde;
  301.     }
  302.     /**
  303.      * Set pruefung [OWNING SIDE]
  304.      *
  305.      * @param \JF\JuridicusBundle\Entity\Pruefung $pruefung
  306.      * @return KundePruefung
  307.      */
  308.     public function setPruefung(Pruefung $pruefung null)
  309.     {
  310.         $this->pruefung $pruefung;
  311.         return $this;
  312.     }
  313.     /**
  314.      * Get pruefung
  315.      *
  316.      * @return \JF\JuridicusBundle\Entity\Pruefung
  317.      */
  318.     public function getPruefung()
  319.     {
  320.         return $this->pruefung;
  321.     }
  322.     /**
  323.      * Set datum_pruefung
  324.      *
  325.      * @param \DateTime $datumPruefung
  326.      * @return KundePruefung
  327.      */
  328.     public function setDatumPruefung(\DateTime $datumPruefung)
  329.     {
  330.         if ($datumPruefung != $this->datum_pruefung) {
  331.             $this->datum_pruefung $datumPruefung;
  332.             if ($this->pruefung) {
  333.                 $this->pruefung->setDatum($datumPruefung);
  334.             }
  335.         }
  336.         return $this;
  337.     }
  338.     /**
  339.      * Get datum_pruefung
  340.      *
  341.      * @return \DateTime
  342.      */
  343.     public function getDatumPruefung()
  344.     {
  345.         return $this->datum_pruefung;
  346.     }
  347.     /**
  348.      * Set datum_buchung
  349.      *
  350.      * @param \DateTime $datumBuchung
  351.      * @return KundePruefung
  352.      */
  353.     public function setDatumBuchung(\DateTime $datumBuchung null)
  354.     {
  355.         $this->datum_buchung $datumBuchung;
  356.         return $this;
  357.     }
  358.     /**
  359.      * Get datum_buchung
  360.      *
  361.      * @return \DateTime
  362.      */
  363.     public function getDatumBuchung()
  364.     {
  365.         return $this->datum_buchung;
  366.     }
  367.     /**
  368.      * Get days since buchungsdatum
  369.      *
  370.      * @return integer | null
  371.      */
  372.     public function getDaysSinceBuchungsdatum()
  373.     {
  374.         if (!$this->datum_buchung) {
  375.             return null;
  376.         }
  377.         $now = new \DateTime();
  378.         return $this->datum_buchung->diff($now)->format('%r%a');
  379.     }
  380.     /**
  381.      * Get days since pruefungsdatum
  382.      *
  383.      * @return integer
  384.      */
  385.     public function getDaysSincePruefungsdatum()
  386.     {
  387.         $now = new \DateTime();
  388.         return $this->datum_pruefung->diff($now)->format('%r%a');
  389.     }
  390.     /**
  391.      * Kunden, die nach 4 Wochen kein Protokoll geschrieben und nicht bezahlt haben, erhalten die CSS-Klass unpaid
  392.      * @return string css class
  393.      */
  394.     public function getCssClass()
  395.     {
  396.         // keine Protokollpflicht => ok
  397.         if ($this->protokollpflicht === false) {
  398.             return 'ok';
  399.         } else if ($this->getBetragGebuehr() && ! $this->gebuehr_bezahlt && $this->getDaysSinceBuchungsdatum() > 28) {
  400.             // 28 Tage nach Buchung keine Gebühr bezahlt => unpaid
  401.             return 'unpaid';
  402.         } else if ($this->getBetragStrafe() && ! $this->strafe_bezahlt && $this->getDaysSincePruefungsdatum() > 28) {
  403.             // 28 Tage nach Prüfung keine Strafe bezahlt => Protokoll untersuchen
  404.             return $this->isProtokollFertig() ? 'ok' 'unpaid';
  405.         }
  406.         return 'ok';
  407.     }
  408.     /**
  409.      *
  410.      * String Representation
  411.      *
  412.      * @return string
  413.      */
  414.     public function __toString()
  415.     {
  416.         if (isset($this->id))
  417.         {
  418.             return sprintf('Buchung #%s - %s - %s',
  419.                 $this->getId(), $this->getDatumPruefung()->format('d.m.Y'), $this->getKunde()->getEmail()
  420.             );
  421.         }
  422.         return 'Neue Buchung';
  423.     }
  424.     /**
  425.      * Set Notiz
  426.      *
  427.      * @param string $notiz
  428.      * @return KundePruefung
  429.      */
  430.     public function setNotiz($notiz)
  431.     {
  432.         $this->notiz $notiz;
  433.         return $this;
  434.     }
  435.     /**
  436.      * Get notiz
  437.      *
  438.      * @return string
  439.      */
  440.     public function getNotiz()
  441.     {
  442.         return $this->notiz;
  443.     }
  444.     /**
  445.      * Add email
  446.      *
  447.      * @param \JF\JuridicusBundle\Entity\Email $email
  448.      * @return KundePruefung
  449.      */
  450.     public function addEmail(Email $email)
  451.     {
  452.         $this->emails[] = $email;
  453.         return $this;
  454.     }
  455.     /**
  456.      * Remove email
  457.      *
  458.      * @param \JF\JuridicusBundle\Entity\Email $email
  459.      */
  460.     public function removeEmail(Email $email)
  461.     {
  462.         $this->emails->removeElement($email);
  463.     }
  464.     /**
  465.      * Get emails
  466.      *
  467.      * @return \Doctrine\Common\Collections\Collection
  468.      */
  469.     public function getEmails()
  470.     {
  471.         return $this->emails;
  472.     }
  473.     /**
  474.      *
  475.      * @param integer $typ
  476.      * @return JF\JuridicusBundle\Entity\Email|null
  477.      */
  478.     public function getEmail($typ)
  479.     {
  480.         foreach ($this->getEmails() as $email) {
  481.             /* @var $email \JF\JuridicusBundle\Entity\Email */
  482.             if ($email->getTyp() == $typ) {
  483.                 return $email;
  484.             }
  485.         }
  486.         return null;
  487.     }
  488.     /**
  489.      *
  490.      * @return Email|null
  491.      */
  492.     public function getEmailRechnung()
  493.     {
  494.         $email_rechnung $this->getEmail(Email::BUCHUNG_RECHNUNG);
  495.         if ($email_rechnung) {
  496.             return $email_rechnung;
  497.         }
  498.         $email_rechnung $this->getEmail(Email::BUCHUNG_RECHNUNG_NACHTRAG);
  499.         if ($email_rechnung) {
  500.             return $email_rechnung;
  501.         }
  502.         return null;
  503.     }
  504.     /**
  505.      *
  506.      * @return string|null
  507.      */
  508.     public function getEndnote()
  509.     {
  510.         $protokoll_infothek_pruefung $this->getProtokollInfothekPruefung();
  511.         if (! $protokoll_infothek_pruefung) {
  512.             return null;
  513.         }
  514.         return $protokoll_infothek_pruefung->getProtokollInfothekNoten()->first()->getEndnote();
  515.     }
  516.     /**
  517.      *
  518.      * @return string|null
  519.      */
  520.     public function getEndnote1()
  521.     {
  522.         $protokoll_infothek_pruefung $this->getProtokollInfothekPruefung();
  523.         if (! $protokoll_infothek_pruefung) {
  524.             return null;
  525.         }
  526.         return $protokoll_infothek_pruefung->getProtokollInfothekNoten()->first()->getEndnote1();
  527.     }
  528.     /**
  529.      * Set gebuehr [OWNING SIDE]
  530.      *
  531.      * @param \JF\JuridicusBundle\Entity\Gebuehr $gebuehr
  532.      * @return KundePruefung
  533.      */
  534.     public function setGebuehr(Gebuehr $gebuehr null)
  535.     {
  536.         $this->gebuehr $gebuehr;
  537.         return $this;
  538.     }
  539.     /**
  540.      * Get gebuehr
  541.      *
  542.      * @return \JF\JuridicusBundle\Entity\Gebuehr
  543.      */
  544.     public function getGebuehr()
  545.     {
  546.         return $this->gebuehr;
  547.     }
  548.     /**
  549.      * Set strafe [OWNING SIDE]
  550.      *
  551.      * @param \JF\JuridicusBundle\Entity\Gebuehr $strafe
  552.      * @return KundePruefung
  553.      */
  554.     public function setStrafe(Gebuehr $strafe null)
  555.     {
  556.         $this->strafe $strafe;
  557.         return $this;
  558.     }
  559.     /**
  560.      * Get strafe
  561.      *
  562.      * @return \JF\JuridicusBundle\Entity\Gebuehr
  563.      */
  564.     public function getStrafe()
  565.     {
  566.         return $this->strafe;
  567.     }
  568.     /**
  569.      * Set pruefungsamt [OWNING SIDE]
  570.      *
  571.      * @param \JF\JuridicusBundle\Entity\Pruefungsamt $pruefungsamt
  572.      * @return KundePruefung
  573.      */
  574.     public function setPruefungsamt(Pruefungsamt $pruefungsamt null)
  575.     {
  576.         $this->pruefungsamt $pruefungsamt;
  577.         return $this;
  578.     }
  579.     /**
  580.      * Get pruefungsamt
  581.      *
  582.      * @return \JF\JuridicusBundle\Entity\Pruefungsamt
  583.      */
  584.     public function getPruefungsamt()
  585.     {
  586.         return $this->pruefungsamt;
  587.     }
  588.     /**
  589.      * Set abgemahnt
  590.      *
  591.      * @param boolean $abgemahnt
  592.      * @return KundePruefung
  593.      */
  594.     public function setAbgemahnt($abgemahnt)
  595.     {
  596.         $this->abgemahnt = (bool) $abgemahnt;
  597.         return $this;
  598.     }
  599.     /**
  600.      * Get abgemahnt
  601.      *
  602.      * @return boolean
  603.      */
  604.     public function getAbgemahnt()
  605.     {
  606.         return $this->abgemahnt;
  607.     }
  608.     /**
  609.      * Add download
  610.      *
  611.      * @param \JF\JuridicusBundle\Entity\Download $download
  612.      * @return KundePruefung
  613.      */
  614.     public function addDownload(Download $download)
  615.     {
  616.         $this->downloads[] = $download;
  617.         return $this;
  618.     }
  619.     /**
  620.      * Remove download
  621.      *
  622.      * @param \JF\JuridicusBundle\Entity\Download $downloads
  623.      */
  624.     public function removeDownload(Download $download)
  625.     {
  626.         $this->downloads->removeElement($download);
  627.     }
  628.     /**
  629.      * Get downloads
  630.      *
  631.      * @return \Doctrine\Common\Collections\Collection
  632.      */
  633.     public function getDownloads()
  634.     {
  635.         return $this->downloads;
  636.     }
  637.     /**
  638.      * Set belohnung
  639.      *
  640.      * @param boolean $belohnung
  641.      * @return KundePruefung
  642.      */
  643.     public function setBelohnung($belohnung)
  644.     {
  645.         $this->belohnung = (bool) $belohnung;
  646.         return $this;
  647.     }
  648.     /**
  649.      * Get belohnung
  650.      *
  651.      * @return boolean
  652.      */
  653.     public function getBelohnung()
  654.     {
  655.         return $this->belohnung;
  656.     }
  657.     /**
  658.      * Set belohnung_bezahlt
  659.      *
  660.      * @param boolean $belohnungBezahlt
  661.      * @return KundePruefung
  662.      */
  663.     public function setBelohnungBezahlt($belohnungBezahlt)
  664.     {
  665.         $this->belohnung_bezahlt = (bool) $belohnungBezahlt;
  666.         return $this;
  667.     }
  668.     /**
  669.      * Get belohnung_bezahlt
  670.      *
  671.      * @return boolean
  672.      */
  673.     public function getBelohnungBezahlt()
  674.     {
  675.         return $this->belohnung_bezahlt;
  676.     }
  677.     /**
  678.      * Set gutschein
  679.      *
  680.      * @param \JF\JuridicusBundle\Entity\Gutschein $gutschein
  681.      * @return KundePruefung
  682.      */
  683.     public function setGutschein(Gutschein $gutschein null)
  684.     {
  685.         $this->gutschein $gutschein;
  686.         return $this;
  687.     }
  688.     /**
  689.      * Get gutschein
  690.      *
  691.      * @return \JF\JuridicusBundle\Entity\Gutschein
  692.      */
  693.     public function getGutschein()
  694.     {
  695.         return $this->gutschein;
  696.     }
  697.     /**
  698.      * Set betrag_gebuehr
  699.      *
  700.      * @param float $betragGebuehr
  701.      * @return KundePruefung
  702.      */
  703.     public function setBetragGebuehr($betragGebuehr)
  704.     {
  705.         $this->betrag_gebuehr $betragGebuehr;
  706.         return $this;
  707.     }
  708.     /**
  709.      * Get betrag_gebuehr
  710.      *
  711.      * @return float
  712.      */
  713.     public function getBetragGebuehr()
  714.     {
  715.         return $this->betrag_gebuehr;
  716.     }
  717.     /**
  718.      * Set betrag_strafe
  719.      *
  720.      * @param float $betragStrafe
  721.      * @return KundePruefung
  722.      */
  723.     public function setBetragStrafe($betragStrafe)
  724.     {
  725.         $this->betrag_strafe $betragStrafe;
  726.         return $this;
  727.     }
  728.     /**
  729.      * Get betrag_strafe
  730.      *
  731.      * @return float
  732.      */
  733.     public function getBetragStrafe()
  734.     {
  735.         return $this->betrag_strafe;
  736.     }
  737.     /**
  738.      * Add rechnung
  739.      *
  740.      * @param \JF\JuridicusBundle\Entity\Rechnung $rechnung
  741.      * @return KundePruefung
  742.      */
  743.     public function addRechnungen(Rechnung $rechnung)
  744.     {
  745.         $this->rechnungen[] = $rechnung;
  746.         $rechnung->setBuchung($this);
  747.         return $this;
  748.     }
  749.     /**
  750.      * Remove rechnung
  751.      *
  752.      * @param \JF\JuridicusBundle\Entity\Rechnung $rechnung
  753.      */
  754.     public function removeRechnungen(Rechnung $rechnung)
  755.     {
  756.         $this->rechnungen->removeElement($rechnung);
  757.         $rechnung->setBuchung(null);
  758.     }
  759.     /**
  760.      * Get rechnungen
  761.      *
  762.      * @return \Doctrine\Common\Collections\Collection
  763.      */
  764.     public function getRechnungen()
  765.     {
  766.         return $this->rechnungen;
  767.     }
  768.     /**
  769.      *
  770.      * @param integer $gebuehr_typ
  771.      * @return Rechnung | null
  772.      */
  773.     public function getRechnung($gebuehr_typ)
  774.     {
  775.         foreach ($this->getRechnungen() as $rechnung) {
  776.             /* @var $rechnung \JF\JuridicusBundle\Entity\Rechnung */
  777.             if ($rechnung->getTyp() == $gebuehr_typ) {
  778.                 return $rechnung;
  779.             }
  780.         }
  781.         return null;
  782.     }
  783.     /**
  784.      *
  785.      * @return boolean
  786.      */
  787.     public function isProtokollFertig()
  788.     {
  789.         $protokoll $this->getProtokollInfothekPruefung();
  790.         return $protokoll && $protokoll->getFertig();
  791.     }
  792.     /**
  793.      * Add shoutbox_messages
  794.      *
  795.      * @param \JF\JuridicusBundle\Entity\ShoutboxMessage $shoutboxMessage
  796.      * @return KundePruefung
  797.      */
  798.     public function addShoutboxMessage(ShoutboxMessage $shoutboxMessage)
  799.     {
  800.         $this->shoutbox_messages[] = $shoutboxMessage;
  801.         $shoutboxMessage->setBuchung($this);
  802.         return $this;
  803.     }
  804.     /**
  805.      * Remove shoutbox_messages
  806.      *
  807.      * @param \JF\JuridicusBundle\Entity\ShoutboxMessage $shoutboxMessage
  808.      */
  809.     public function removeShoutboxMessage(ShoutboxMessage $shoutboxMessage)
  810.     {
  811.         $this->shoutbox_messages->removeElement($shoutboxMessage);
  812.         $shoutboxMessage->setBuchung(null);
  813.     }
  814.     /**
  815.      * Get shoutbox_messages
  816.      *
  817.      * @return \Doctrine\Common\Collections\Collection
  818.      */
  819.     public function getShoutboxMessages()
  820.     {
  821.         return $this->shoutbox_messages;
  822.     }
  823.     /**
  824.      * Set klausurprotokollpflicht
  825.      *
  826.      * @param boolean $klausurprotokollpflicht
  827.      * @return Kunde
  828.      */
  829.     public function setKlausurprotokollpflicht($klausurprotokollpflicht true)
  830.     {
  831.         $this->klausurprotokollpflicht = (bool) $klausurprotokollpflicht;
  832.         return $this;
  833.     }
  834.     /**
  835.      * Get klausurprotokollpflicht
  836.      *
  837.      * @return boolean
  838.      */
  839.     public function getKlausurprotokollpflicht()
  840.     {
  841.         return $this->klausurprotokollpflicht;
  842.     }
  843.     /**
  844.      * Set protokoll_klausur
  845.      *
  846.      * @param \JF\JuridicusBundle\Entity\ProtokollKlausur $protokollKlausur
  847.      * @return Kunde
  848.      */
  849.     public function setProtokollKlausur(ProtokollKlausur $protokollKlausur null)
  850.     {
  851.         $this->protokoll_klausur $protokollKlausur;
  852.         if ($protokollKlausur) {
  853.             $protokollKlausur->setKundePruefung($this);
  854.         }
  855.         return $this;
  856.     }
  857.     /**
  858.      * Get protokoll_klausur
  859.      *
  860.      * @return \JF\JuridicusBundle\Entity\ProtokollKlausur
  861.      */
  862.     public function getProtokollKlausur()
  863.     {
  864.         return $this->protokoll_klausur;
  865.     }
  866.     /**
  867.      * Set protokoll_aktenvortrag
  868.      *
  869.      * @param \JF\JuridicusBundle\Entity\ProtokollAktenvortrag $protokollAktenvortrag
  870.      * @return Kunde
  871.      */
  872.     public function setProtokollAktenvortrag(ProtokollAktenvortrag $protokollAktenvortrag null)
  873.     {
  874.         $this->protokoll_aktenvortrag $protokollAktenvortrag;
  875.         if ($protokollAktenvortrag) {
  876.             $protokollAktenvortrag->setKundePruefung($this);
  877.         }
  878.         return $this;
  879.     }
  880.     /**
  881.      * Get protokoll_aktenvortrag
  882.      *
  883.      * @return \JF\JuridicusBundle\Entity\ProtokollAktenvortrag
  884.      */
  885.     public function getProtokollAktenvortrag()
  886.     {
  887.         return $this->protokoll_aktenvortrag;
  888.     }
  889.     /**
  890.      *
  891.      * @return boolean
  892.      */
  893.     public function needsKlausurprotokoll()
  894.     {
  895.         if ($this->getKlausurprotokollpflicht()) {
  896.             $protokoll_klausur $this->getProtokollKlausur();
  897.             if (!$protokoll_klausur || !$protokoll_klausur->isFertig()) {
  898.                 return true;
  899.             }
  900.         }
  901.         return false;
  902.     }
  903.     /**
  904.      * Set pflicht_facebook_post
  905.      *
  906.      * @param boolean $pflichtFacebookPost
  907.      * @return KundePruefung
  908.      */
  909.     public function setPflichtFacebookPost($pflichtFacebookPost)
  910.     {
  911.         $this->pflicht_facebook_post = (bool) $pflichtFacebookPost;
  912.         return $this;
  913.     }
  914.     /**
  915.      * Get pflicht_facebook_post
  916.      *
  917.      * @return boolean
  918.      */
  919.     public function getPflichtFacebookPost()
  920.     {
  921.         return $this->pflicht_facebook_post;
  922.     }
  923.     /**
  924.      * Set wrote_facebook_post
  925.      *
  926.      * @param boolean $wroteFacebookPost
  927.      * @return KundePruefung
  928.      */
  929.     public function setWroteFacebookPost($wroteFacebookPost)
  930.     {
  931.         $this->wrote_facebook_post = (bool) $wroteFacebookPost;
  932.         return $this;
  933.     }
  934.     /**
  935.      * Get wrote_facebook_post
  936.      *
  937.      * @return boolean
  938.      */
  939.     public function getWroteFacebookPost()
  940.     {
  941.         return $this->wrote_facebook_post;
  942.     }
  943.     /**
  944.      *
  945.      * @return boolean
  946.      */
  947.     public function needsFacebookPost()
  948.     {
  949.         return $this->pflicht_facebook_post && !$this->wrote_facebook_post;
  950.     }
  951. }