src/JuridicusBundle/Entity/Kunde.php line 18

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 Doctrine\Common\Collections\ArrayCollection;
  8. /**
  9.  * @ORM\Entity
  10.  * @UniqueEntity(fields={"email","examen"}, message="Die Kombination aus E-Mail und Examen wird bereits verwendet.")
  11.  * @UniqueEntity(fields={"kennziffer","examen"}, message="Die Kombination aus Kennziffer und Examen wird bereits verwendet.")
  12.  * @UniqueEntity(fields={"handynummer","examen"}, message="Die Kombination aus Handynummer und Examen wird bereits verwendet.")
  13.  */
  14. class Kunde extends InitModeEntity
  15. {    
  16.     const CLASSNAME __CLASS__;
  17.     
  18.     /**
  19.      * @var integer
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var string
  24.      * @Assert\NotBlank(message="Der Vorname darf nicht leer sein.")
  25.      * @Assert\Length(max="255")
  26.      */
  27.     private $vorname;
  28.     /**
  29.      * @var string
  30.      * @Assert\NotBlank(message="Der Nachname darf nicht leer sein.")
  31.      * @Assert\Length(max="255")
  32.      */
  33.     private $nachname;
  34.     /**
  35.      * @var string
  36.      * @Assert\NotBlank(message="Die E-Mail-Adresse darf nicht leer sein.")
  37.      * @Assert\Email
  38.      * @Assert\Length(max="128")
  39.      * @JfAssert\EmailRole
  40.      */
  41.     private $email;
  42.     /**
  43.      * @var string
  44.      * @Assert\NotBlank(message="Die Straße darf nicht leer sein.")
  45.      * @Assert\Length(max="48")
  46.      */
  47.     private $strasse;
  48.     /**
  49.      * @var string
  50.      * @Assert\NotBlank(message="Die Hausnummer darf nicht leer sein.")
  51.      * @Assert\Length(max="6")
  52.      */
  53.     private $hausnummer;
  54.     /**
  55.      * @var string
  56.      * @Assert\NotBlank(message="Die PLZ darf nicht leer sein.")
  57.      * @Assert\Regex(pattern="/^\d{5}$/", message = "Die PLZ muss aus 5 Ziffern bestehen.")
  58.      */
  59.     private $plz;
  60.     /**
  61.      * @var string
  62.      * @Assert\NotBlank(message="Der Ort darf nicht leer sein.")
  63.      * @Assert\Length(max="48")
  64.      */
  65.     private $ort;
  66.     /**
  67.      * @var string
  68.      * @Assert\NotBlank(message="Die Handynummer darf nicht leer sein.")
  69.      * @Assert\Length(max="20")
  70.      */
  71.     private $handynummer;
  72.     /**
  73.      * @var integer
  74.      * @Assert\NotBlank(groups={"Default","step-1"})
  75.      */
  76.     private $examen;
  77.     /**
  78.      * @var \DateTimeInterface|null
  79.      * @Assert\Type(\DateTimeInterface::class)
  80.      */
  81.     private $geburtsdatum;
  82.     /**
  83.      * @var string
  84.      * @Assert\Length(max="20")
  85.      */
  86.     private $telefonnummer;
  87.     /**
  88.      * @var string
  89.      * @Assert\Length(max="8")
  90.      */
  91.     private $kennziffer;
  92.     /**
  93.      * @var boolean
  94.      */
  95.     private $export_erlaubt false;
  96.    /**
  97.      * @var boolean
  98.      */
  99.     private $anruf_erlaubt false;
  100.     /**
  101.      * @var boolean
  102.      */
  103.     private $logged_in false;
  104.     /**
  105.      * @var \DateTime
  106.       * @Assert\Type(\DateTimeInterface::class)
  107.      */
  108.     private $sms_send_at;
  109.     /**
  110.      * @var integer
  111.      */
  112.     private $sms_status_id;
  113.     /**
  114.      *
  115.      * @var string
  116.      */
  117.     private $sms_status_message 'Unbekannt';
  118.     /**
  119.      * @var boolean
  120.      */
  121.     private $verkaeufer false;
  122.     /**
  123.      * @var string
  124.      */
  125.     private $notiz;
  126.     /**
  127.      * @var string
  128.      */
  129.     private $kontoinhaber;
  130.     /**
  131.      * @var string
  132.      */
  133.     private $kontonummer;
  134.     /**
  135.      * @var string
  136.      */
  137.     private $bank;
  138.     /**
  139.      * @var string
  140.      */
  141.     private $blz;
  142.     /**
  143.      * @var string
  144.      */
  145.     private $iban;
  146.     /**
  147.      * @var string
  148.      */
  149.     private $bic;
  150.     /**
  151.      * @var \JF\JuridicusBundle\Entity\Bundesland
  152.      * @Assert\NotBlank(groups={"Default","step-1"})
  153.      * @Assert\Valid
  154.      */
  155.     private $bundesland;
  156.     /**
  157.      * @var float
  158.      */
  159.     private $betrag_strafe;
  160.     /**
  161.      * @var boolean
  162.      */
  163.     private $strafe_bezahlt false;
  164.     /**
  165.      * @var \JF\JuridicusBundle\Entity\User
  166.      * @Assert\Valid
  167.      */
  168.     private $user;
  169.     /**
  170.      * @var \DateTime
  171.      */
  172.     private $created_at;
  173.     /**
  174.      * @var \JF\JuridicusBundle\Entity\PdfStempel
  175.      */
  176.     private $pdf_stempel;
  177.     /**
  178.      * @var \Doctrine\Common\Collections\Collection
  179.      */
  180.     private $downloads;
  181.     /**
  182.      * @var \Doctrine\Common\Collections\Collection
  183.      */
  184.     private $emails;
  185.     /**
  186.      * @var \Doctrine\Common\Collections\Collection
  187.      */
  188.     private $empfehlungen;
  189.     /**
  190.      * @var \Doctrine\Common\Collections\Collection
  191.      */
  192.     private $exporte;
  193.     /**
  194.      * @var \Doctrine\Common\Collections\Collection
  195.      */
  196.     private $kunde_kenntnisse;
  197.     
  198.     /**
  199.      * @var string
  200.      */
  201.     private $kunde_englisch_kenntniss;
  202.     
  203.     /**
  204.      * @var string
  205.      */
  206.     private $kunde_wunsch_arbeitsort;
  207.     /**
  208.      * @var \Doctrine\Common\Collections\Collection
  209.      */
  210.     private $kunde_pruefungen;
  211.     /**
  212.      * @var \Doctrine\Common\Collections\Collection
  213.      */
  214.     private $rechnungen;
  215.     /**
  216.      * @var \DateTime
  217.      */
  218.     private $sperrdatum;
  219.     /**
  220.      * @var boolean
  221.      */
  222.     private $pdf_need_update true;
  223.     /**
  224.      * @var \JF\JuridicusBundle\Entity\Abo
  225.      */
  226.     private $abo;
  227.     /**
  228.      *
  229.      * @var boolean
  230.      */
  231.     private $klausurprotokollpflicht true;
  232.     /**
  233.      * @var boolean
  234.      */
  235.     private $pflicht_facebook_post false;
  236.     /**
  237.      *
  238.      * @var boolean
  239.      */
  240.     private $notenpflicht true;
  241.     /**
  242.      * Constructor
  243.      */
  244.     public function __construct()
  245.     {
  246.         $this->exporte = new ArrayCollection();
  247.         $this->downloads = new ArrayCollection();
  248.         $this->emails = new ArrayCollection();
  249.         $this->empfehlungen = new ArrayCollection();
  250.         $this->kunde_kenntnisse = new ArrayCollection();
  251.         $this->kunde_pruefungen = new ArrayCollection();
  252.         $this->rechnungen = new ArrayCollection();
  253.     }
  254.     /**
  255.      * Get id
  256.      *
  257.      * @return integer
  258.      */
  259.     public function getId()
  260.     {
  261.         return $this->id;
  262.     }
  263.     /**
  264.      * Add exporte
  265.      *
  266.      * @param \JF\JuridicusBundle\Entity\Export $exporte
  267.      * @return Kunde
  268.      */
  269.     public function addExporte(Export $exporte)
  270.     {
  271.         $this->exporte[] = $exporte;
  272.         return $this;
  273.     }
  274.     /**
  275.      * Remove exporte
  276.      *
  277.      * @param \JF\JuridicusBundle\Entity\Export $exporte
  278.      */
  279.     public function removeExporte(Export $exporte)
  280.     {
  281.         $this->exporte->removeElement($exporte);
  282.     }
  283.     /**
  284.      * Get exporte
  285.      *
  286.      * @return \Doctrine\Common\Collections\Collection
  287.      */
  288.     public function getExporte()
  289.     {
  290.         return $this->exporte;
  291.     }
  292.     /**
  293.      * Set kennziffer
  294.      *
  295.      * @param string $kennziffer
  296.      * @return Kunde
  297.      */
  298.     public function setKennziffer($kennziffer)
  299.     {
  300.         $this->kennziffer $kennziffer;
  301.         return $this;
  302.     }
  303.     /**
  304.      * Get kennziffer
  305.      *
  306.      * @return string
  307.      */
  308.     public function getKennziffer()
  309.     {
  310.         return $this->kennziffer;
  311.     }
  312.     /**
  313.      * Set export_erlaubt
  314.      *
  315.      * @param boolean $exportErlaubt
  316.      * @return Kunde
  317.      */
  318.     public function setExportErlaubt($exportErlaubt)
  319.     {
  320.         $this->export_erlaubt = (bool) $exportErlaubt;
  321.         return $this;
  322.     }
  323.     /**
  324.      * Get export_erlaubt
  325.      *
  326.      * @return boolean
  327.      */
  328.     public function getExportErlaubt()
  329.     {
  330.         return $this->export_erlaubt;
  331.     }
  332.     /**
  333.      * Set user [OWNING SIDE]
  334.      *
  335.      * @param User $user
  336.      * @return Kunde
  337.      */
  338.     public function setUser(User $user null)
  339.     {
  340.         $this->user $user;
  341.         return $this;
  342.     }
  343.     /**
  344.      * Get user
  345.      *
  346.      * @return User
  347.      */
  348.     public function getUser()
  349.     {
  350.         return $this->user;
  351.     }
  352.     /**
  353.      * Add downloads [INVERSE SIDE]
  354.      *
  355.      * @param \JF\JuridicusBundle\Entity\Download $downloads
  356.      * @return Kunde
  357.      */
  358.     public function addDownload(Download $downloads)
  359.     {
  360.         $this->downloads[] = $downloads;
  361.         $downloads->setKunde($this);
  362.         return $this;
  363.     }
  364.     /**
  365.      * Remove downloads [INVERSE SIDE]
  366.      *
  367.      * @param \JF\JuridicusBundle\Entity\Download $downloads
  368.      */
  369.     public function removeDownload(Download $downloads)
  370.     {
  371.         $this->downloads->removeElement($downloads);
  372.         $downloads->setKunde(null);
  373.     }
  374.     /**
  375.      * Get downloads
  376.      *
  377.      * @return \Doctrine\Common\Collections\Collection
  378.      */
  379.     public function getDownloads()
  380.     {
  381.         return $this->downloads;
  382.     }
  383.     /**
  384.      * Add email
  385.      *
  386.      * @param \JF\JuridicusBundle\Entity\Email $email
  387.      * @return Kunde
  388.      */
  389.     public function addEmail(Email $email)
  390.     {
  391.         $this->emails[] = $email;
  392.         return $this;
  393.     }
  394.     /**
  395.      * Remove email
  396.      *
  397.      * @param \JF\JuridicusBundle\Entity\Email $emails
  398.      */
  399.     public function removeEmail(Email $email)
  400.     {
  401.         $this->emails->removeElement($email);
  402.     }
  403.     /**
  404.      * Get emails
  405.      *
  406.      * @return \Doctrine\Common\Collections\Collection
  407.      */
  408.     public function getEmails()
  409.     {
  410.         return $this->emails;
  411.     }
  412.     /**
  413.      * Add empfehlungen [INVERSE SIDE]
  414.      *
  415.      * @param \JF\JuridicusBundle\Entity\Empfehlung $empfehlung
  416.      * @return Kunde
  417.      */
  418.     public function addEmpfehlungen(Empfehlung $empfehlung)
  419.     {
  420.         $this->empfehlungen[] = $empfehlung;
  421.         return $this;
  422.     }
  423.     /**
  424.      * Remove empfehlungen [INVERSE SIDE]
  425.      *
  426.      * @param \JF\JuridicusBundle\Entity\Empfehlung $empfehlung
  427.      */
  428.     public function removeEmpfehlungen(Empfehlung $empfehlung)
  429.     {
  430.         $this->empfehlungen->removeElement($empfehlungen);
  431.     }
  432.     /**
  433.      * Get empfehlungen
  434.      *
  435.      * @return \Doctrine\Common\Collections\Collection
  436.      */
  437.     public function getEmpfehlungen()
  438.     {
  439.         return $this->empfehlungen;
  440.     }
  441.     /**
  442.      * Add kunde_kenntnisse [INVERSE SIDE]
  443.      *
  444.      * @param \JF\JuridicusBundle\Entity\KundeKenntnis $kundeKenntnis
  445.      * @return Kunde
  446.      */
  447.     public function addKundeKenntnisse(KundeKenntnis $kundeKenntnis)
  448.     {
  449.         $this->kunde_kenntnisse[] = $kundeKenntnis;
  450.         $kundeKenntnis->setKunde($this);
  451.         return $this;
  452.     }
  453.     /**
  454.      * Remove kunde_kenntnisse [INVERSE SIDE]
  455.      *
  456.      * @param \JF\JuridicusBundle\Entity\KundeKenntnis $kundeKenntnis
  457.      */
  458.     public function removeKundeKenntnisse(KundeKenntnis $kundeKenntnis)
  459.     {
  460.         $this->kunde_kenntnisse->removeElement($kundeKenntnis);
  461.         $kundeKenntnis->setKunde(null);
  462.     }
  463.     /**
  464.      * Get kunde_kenntnisse
  465.      *
  466.      * @return \Doctrine\Common\Collections\Collection
  467.      */
  468.     public function getKundeKenntnisse()
  469.     {
  470.         return $this->kunde_kenntnisse;
  471.     }
  472.     
  473.     /**
  474.      * Set kunde_englisch_kenntniss 
  475.      *
  476.      * @param string $bundesland
  477.      * @return Kunde
  478.      */
  479.     public function setKundeEnglischKenntniss(String $kunde_englisch_kenntniss)
  480.     {
  481.         $this->kunde_englisch_kenntniss $kunde_englisch_kenntniss;
  482.         return $this;
  483.     }
  484.     /**
  485.      * Get kunde_englisch_kenntniss
  486.      *
  487.      * @return string
  488.      */
  489.     public function getKundeEnglischKenntniss()
  490.     {
  491.         return $this->kunde_englisch_kenntniss;
  492.     }
  493.     
  494.     
  495.     /**
  496.      * Set kunde_wunsch_arbeitsort 
  497.      *
  498.      * @param string $bundesland
  499.      * @return Kunde
  500.      */
  501.     public function setKundeWunschArbeitsort(String $kunde_wunsch_arbeitsort)
  502.     {
  503.         $this->kunde_wunsch_arbeitsort $kunde_wunsch_arbeitsort;
  504.         return $this;
  505.     }
  506.     /**
  507.      * Get kunde_wunsch_arbeitsort
  508.      *
  509.      * @return string
  510.      */
  511.     public function getKundeWunschArbeitsort()
  512.     {
  513.         return $this->kunde_wunsch_arbeitsort;
  514.     }
  515.     
  516.     /**
  517.      * Set bundesland [OWNING SIDE]
  518.      *
  519.      * @param \JF\JuridicusBundle\Entity\Bundesland $bundesland
  520.      * @return Kunde
  521.      */
  522.     public function setBundesland(Bundesland $bundesland null)
  523.     {
  524.         $this->bundesland $bundesland;
  525.         return $this;
  526.     }
  527.     /**
  528.      * Get bundesland
  529.      *
  530.      * @return \JF\JuridicusBundle\Entity\Bundesland
  531.      */
  532.     public function getBundesland()
  533.     {
  534.         return $this->bundesland;
  535.     }
  536.     /**
  537.      * __toString
  538.      *
  539.      * @return string String-Repräsentation des Kunden
  540.      */
  541.     public function __toString()
  542.     {
  543.         if ($this->getId())    {
  544.             return $this->getEmail();
  545.         } else {
  546.             return 'Neuer Kunde';
  547.         }
  548.     }
  549.     /**
  550.      * Set pdf_stempel [INVERSE SIDE]
  551.      *
  552.      * @param \JF\JuridicusBundle\Entity\PdfStempel $pdfStempel
  553.      * @return Kunde
  554.      */
  555.     public function setPdfStempel(PdfStempel $pdfStempel null)
  556.     {
  557.         $this->pdf_stempel $pdfStempel;
  558.         return $this;
  559.     }
  560.     /**
  561.      * Get pdf_stempel
  562.      *
  563.      * @return \JF\JuridicusBundle\Entity\PdfStempel
  564.      */
  565.     public function getPdfStempel()
  566.     {
  567.         return $this->pdf_stempel;
  568.     }
  569.     /**
  570.      *
  571.      * @return string
  572.      */
  573.     public function getStempelText()
  574.     {
  575.         return sprintf(
  576.             'Persönliche Kopie für %s %s %s- %s - %s',
  577.             $this->vorname,
  578.             $this->nachname,
  579.             $this->kennziffer sprintf('(%s) '$this->kennziffer ) : '',
  580.             $this->email,
  581.             $this->handynummer
  582.         );
  583.     }
  584.     /**
  585.      * Add kunde_pruefungen [INVERSE SIDE]
  586.      *
  587.      * @param \JF\JuridicusBundle\Entity\KundePruefung $kundePruefungen
  588.      * @return Kunde
  589.      */
  590.     public function addKundePruefungen(KundePruefung $kundePruefungen)
  591.     {
  592.         $this->kunde_pruefungen[] = $kundePruefungen;
  593.         return $this;
  594.     }
  595.     /**
  596.      * Remove kunde_pruefungen [INVERSE SIDE]
  597.      *
  598.      * @param \JF\JuridicusBundle\Entity\KundePruefung $kundePruefung
  599.      */
  600.     public function removeKundePruefungen(KundePruefung $kundePruefung)
  601.     {
  602.         $this->kunde_pruefungen->removeElement($kundePruefung);
  603.     }
  604.     /**
  605.      * Get kunde_pruefungen
  606.      *
  607.      * @return \Doctrine\Common\Collections\Collection
  608.      */
  609.     public function getKundePruefungen()
  610.     {
  611.         return $this->kunde_pruefungen;
  612.     }
  613.     /**
  614.      *
  615.      * @return int
  616.      */
  617.     public function getAnzahlBuchungen()
  618.     {
  619.         return $this->getKundePruefungen()->count();
  620.     }
  621.     /**
  622.      *
  623.      * @param \JF\JuridicusBundle\Entity\Pruefung $pruefung
  624.      * @return boolean
  625.      */
  626.     public function isGebucht(Pruefung $pruefung)
  627.     {
  628.         foreach ($this->getKundePruefungen() as $buchung) {
  629.             /* @var $buchung \JF\JuridicusBundle\Entity\KundePruefung */
  630.             if ($buchung->getPruefung()->getId() == $pruefung->getId()) {
  631.                 return true;
  632.             }
  633.         }
  634.         return false;
  635.     }
  636.     /**
  637.      *
  638.      * @param \JF\JuridicusBundle\Entity\Pruefung $pruefung
  639.      * @return \JF\JuridicusBundle\Entity\KundePruefung|null
  640.      */
  641.     public function findBuchung(Pruefung $pruefung)
  642.     {
  643.         foreach ($this->getKundePruefungen() as $buchung) {
  644.             /* @var $buchung \JF\JuridicusBundle\Entity\KundePruefung */
  645.             if ($buchung->getPruefung()->getId() == $pruefung->getId()) {
  646.                 return $buchung;
  647.             }
  648.         }
  649.         return null;
  650.     }
  651.     /**
  652.      * ermittelt das Datum, das für die Bereitstellung der letzten 3 ZA-Ausgaben verwendet wird
  653.      * @return \DateTime
  654.      */
  655.     public function getZAStichtag()
  656.     {
  657.         $newest_date $this->getCreatedAt();
  658.         foreach ($this->getKundePruefungen() as $buchung) {
  659.             $date $buchung->getDatumBuchung();
  660.             if ($date && $date $newest_date) {
  661.                 $newest_date $date;
  662.             }
  663.         }
  664.         
  665.         return $newest_date;
  666.     }
  667.     /**
  668.      *
  669.      * @return boolean
  670.      */
  671.     public function hasBuchung()
  672.     {
  673.         return ! $this->getKundePruefungen()->isEmpty();
  674.     }
  675.     /**
  676.      * Set strasse
  677.      *
  678.      * @param string $strasse
  679.      * @return Kunde
  680.      */
  681.     public function setStrasse($strasse)
  682.     {
  683.         $this->strasse $strasse;
  684.         return $this;
  685.     }
  686.     /**
  687.      * Get strasse
  688.      *
  689.      * @return string
  690.      */
  691.     public function getStrasse()
  692.     {
  693.         return $this->strasse;
  694.     }
  695.     /**
  696.      * Set hausnummer
  697.      *
  698.      * @param string $hausnummer
  699.      * @return Kunde
  700.      */
  701.     public function setHausnummer($hausnummer)
  702.     {
  703.         $this->hausnummer $hausnummer;
  704.         return $this;
  705.     }
  706.     /**
  707.      * Get hausnummer
  708.      *
  709.      * @return string
  710.      */
  711.     public function getHausnummer()
  712.     {
  713.         return $this->hausnummer;
  714.     }
  715.     /**
  716.      * Get Strasse und Hausnummer
  717.      *
  718.      * @return string
  719.      */
  720.     public function getStrasseAndHausnummer()
  721.     {
  722.         return sprintf'%s %s'$this->strasse$this->hausnummer);
  723.     }
  724.     /**
  725.      * Set plz
  726.      *
  727.      * @param string $plz
  728.      * @return Kunde
  729.      */
  730.     public function setPlz($plz)
  731.     {
  732.         $this->plz $plz;
  733.         return $this;
  734.     }
  735.     /**
  736.      * Get plz
  737.      *
  738.      * @return string
  739.      */
  740.     public function getPlz()
  741.     {
  742.         return $this->plz;
  743.     }
  744.     /**
  745.      * Set ort
  746.      *
  747.      * @param string $ort
  748.      * @return Kunde
  749.      */
  750.     public function setOrt($ort)
  751.     {
  752.         $this->ort $ort;
  753.         return $this;
  754.     }
  755.     /**
  756.      * Get ort
  757.      *
  758.      * @return string
  759.      */
  760.     public function getOrt()
  761.     {
  762.         return $this->ort;
  763.     }
  764.     /**
  765.      * Get PLZ and Ort
  766.      *
  767.      * @return string
  768.      */
  769.     public function getPlzAndOrt()
  770.     {
  771.         return sprintf('%s %s'$this->plz$this->ort);
  772.     }
  773.     /**
  774.      * Set handynummer
  775.      *
  776.      * @param string $handynummer
  777.      * @return Kunde
  778.      */
  779.     public function setHandynummer($handynummer)
  780.     {
  781.         $this->handynummer $handynummer;
  782.         return $this;
  783.     }
  784.     /**
  785.      * Get handynummer
  786.      *
  787.      * @return string
  788.      */
  789.     public function getHandynummer()
  790.     {
  791.         return $this->handynummer;
  792.     }
  793.     /**
  794.      * Set examen
  795.      *
  796.      * @param integer $examen
  797.      * @return Kunde
  798.      */
  799.     public function setExamen($examen)
  800.     {
  801.         $this->examen $examen;
  802.         return $this;
  803.     }
  804.     /**
  805.      * Get examen
  806.      *
  807.      * @return integer
  808.      */
  809.     public function getExamen()
  810.     {
  811.         return $this->examen;
  812.     }
  813.     /**
  814.      * Set logged_in
  815.      *
  816.      * @param boolean $loggedIn
  817.      * @return Kunde
  818.      */
  819.     public function setLoggedIn($loggedIn)
  820.     {
  821.         $this->logged_in = (bool) $loggedIn;
  822.         return $this;
  823.     }
  824.     /**
  825.      * Get logged_in
  826.      *
  827.      * @return boolean
  828.      */
  829.     public function getLoggedIn()
  830.     {
  831.         return $this->logged_in;
  832.     }
  833.     /**
  834.      * Set sms_send_at
  835.      *
  836.      * @param \DateTime $smsSendAt
  837.      * @return Kunde
  838.      */
  839.     public function setSmsSendAt(\DateTime $smsSendAt null)
  840.     {
  841.         $this->sms_send_at $smsSendAt;
  842.         return $this;
  843.     }
  844.     /**
  845.      * Get sms_send_at
  846.      *
  847.      * @return \DateTime
  848.      */
  849.     public function getSmsSendAt()
  850.     {
  851.         return $this->sms_send_at;
  852.     }
  853.     /**
  854.      * Set notiz
  855.      *
  856.      * @param string $notiz
  857.      * @return Kunde
  858.      */
  859.     public function setNotiz($notiz)
  860.     {
  861.         $this->notiz $notiz;
  862.         return $this;
  863.     }
  864.     /**
  865.      * Get notiz
  866.      *
  867.      * @return string
  868.      */
  869.     public function getNotiz()
  870.     {
  871.         return $this->notiz;
  872.     }
  873.     /**
  874.      * Set vorname
  875.      *
  876.      * @param string $vorname
  877.      * @return Kunde
  878.      */
  879.     public function setVorname($vorname)
  880.     {
  881.         $this->vorname $vorname;
  882.         return $this;
  883.     }
  884.     /**
  885.      * Get vorname
  886.      *
  887.      * @return string
  888.      */
  889.     public function getVorname()
  890.     {
  891.         return $this->vorname;
  892.     }
  893.     /**
  894.      * Set nachname
  895.      *
  896.      * @param string $nachname
  897.      * @return Kunde
  898.      */
  899.     public function setNachname($nachname)
  900.     {
  901.         $this->nachname $nachname;
  902.         return $this;
  903.     }
  904.     /**
  905.      * Get nachname
  906.      *
  907.      * @return string
  908.      */
  909.     public function getNachname()
  910.     {
  911.         return $this->nachname;
  912.     }
  913.     /**
  914.      * Get name
  915.      *
  916.      * @return string
  917.      */
  918.     public function getName()
  919.     {
  920.         return sprintf'%s %s'$this->vorname$this->nachname);
  921.     }
  922.     /**
  923.      * Set email
  924.      *
  925.      * @param string $email
  926.      * @return Kunde
  927.      */
  928.     public function setEmail($email)
  929.     {
  930.         $this->email $email;
  931.         return $this;
  932.     }
  933.     /**
  934.      * Get email
  935.      *
  936.      * @return string
  937.      */
  938.     public function getEmail()
  939.     {
  940.         return $this->email;
  941.     }
  942.     /**
  943.      * Set geburtsdatum
  944.      *
  945.      * @param \DateTime $geburtsdatum
  946.      * @return Kunde
  947.      */
  948.     public function setGeburtsdatum(\DateTime $geburtsdatum null)
  949.     {
  950.         $this->geburtsdatum $geburtsdatum;
  951.         return $this;
  952.     }
  953.     /**
  954.      * Get geburtsdatum
  955.      *
  956.      * @return \DateTime
  957.      */
  958.     public function getGeburtsdatum()
  959.     {
  960.         return $this->geburtsdatum;
  961.     }
  962.     /**
  963.      * Set telefonnummer
  964.      *
  965.      * @param string $telefonnummer
  966.      * @return Kunde
  967.      */
  968.     public function setTelefonnummer($telefonnummer)
  969.     {
  970.         $this->telefonnummer $telefonnummer;
  971.         return $this;
  972.     }
  973.     /**
  974.      * Get telefonnummer
  975.      *
  976.      * @return string
  977.      */
  978.     public function getTelefonnummer()
  979.     {
  980.         return $this->telefonnummer;
  981.     }
  982.     /**
  983.      * Get days since registration
  984.      *
  985.      * @return integer
  986.      */
  987.     public function getDaysSinceRegistration()
  988.     {
  989.         $now = new \DateTime();
  990.         return $this->created_at->diff($now)->format('%r%a');
  991.     }
  992.     /**
  993.      *
  994.      * @return string
  995.      */
  996.     public function getCssClass()
  997.     {
  998.         if ($this->getAnzahlBuchungen() > 0)
  999.         {
  1000.             return 'ok';
  1001.         }
  1002.         if ($this->betrag_strafe && $this->strafe_bezahlt === false && $this->getDaysSinceRegistration() > 28)
  1003.         {
  1004.             return 'unpaid';
  1005.         }
  1006.         return 'ok';
  1007.     }
  1008.     /**
  1009.      * Add to Pdf
  1010.      *
  1011.      * @param \TCPDF
  1012.      */
  1013.     public function addToPdf(\TCPDF $pdf)
  1014.     {
  1015.         $txt sprintf(
  1016.             '© %s by Juridicus. Die Weitergabe dieser Kopie ist nicht erlaubt und wird strafrechtlich geahndet.',
  1017.             date('Y')
  1018.         );
  1019.         $pdf->Cell(00$txt01'L');
  1020.         $pdf->Cell(00$this->getStempelText(), 01'L');
  1021.     }
  1022.     /**
  1023.      * Set created_at
  1024.      *
  1025.      * @param \DateTime $createdAt
  1026.      * @return Kunde
  1027.      */
  1028.     public function setCreatedAt(\DateTime $createdAt null)
  1029.     {
  1030.         $this->created_at $createdAt;
  1031.         return $this;
  1032.     }
  1033.     /**
  1034.      * Get created_at
  1035.      *
  1036.      * @return \DateTime
  1037.      */
  1038.     public function getCreatedAt()
  1039.     {
  1040.         return $this->created_at;
  1041.     }
  1042.     /**
  1043.      * Set anruf_erlaubt
  1044.      *
  1045.      * @param boolean $anrufErlaubt
  1046.      * @return Kunde
  1047.      */
  1048.     public function setAnrufErlaubt($anrufErlaubt)
  1049.     {
  1050.         $this->anruf_erlaubt = (bool) $anrufErlaubt;
  1051.         return $this;
  1052.     }
  1053.     /**
  1054.      * Get anruf_erlaubt
  1055.      *
  1056.      * @return boolean
  1057.      */
  1058.     public function getAnrufErlaubt()
  1059.     {
  1060.         return $this->anruf_erlaubt;
  1061.     }
  1062.     /**
  1063.      * Set kontoinhaber
  1064.      *
  1065.      * @param string $kontoinhaber
  1066.      * @return Kunde
  1067.      */
  1068.     public function setKontoinhaber($kontoinhaber)
  1069.     {
  1070.         $this->kontoinhaber $kontoinhaber;
  1071.         return $this;
  1072.     }
  1073.     /**
  1074.      * Get kontoinhaber
  1075.      *
  1076.      * @return string
  1077.      */
  1078.     public function getKontoinhaber()
  1079.     {
  1080.         return $this->kontoinhaber;
  1081.     }
  1082.     /**
  1083.      * Set kontonummer
  1084.      *
  1085.      * @param string $kontonummer
  1086.      * @return Kunde
  1087.      */
  1088.     public function setKontonummer($kontonummer)
  1089.     {
  1090.         $this->kontonummer $kontonummer;
  1091.         return $this;
  1092.     }
  1093.     /**
  1094.      * Get kontonummer
  1095.      *
  1096.      * @return string
  1097.      */
  1098.     public function getKontonummer()
  1099.     {
  1100.         return $this->kontonummer;
  1101.     }
  1102.     /**
  1103.      * Set bank
  1104.      *
  1105.      * @param string $bank
  1106.      * @return Kunde
  1107.      */
  1108.     public function setBank($bank)
  1109.     {
  1110.         $this->bank $bank;
  1111.         return $this;
  1112.     }
  1113.     /**
  1114.      * Get bank
  1115.      *
  1116.      * @return string
  1117.      */
  1118.     public function getBank()
  1119.     {
  1120.         return $this->bank;
  1121.     }
  1122.     /**
  1123.      * Set blz
  1124.      *
  1125.      * @param string $blz
  1126.      * @return Kunde
  1127.      */
  1128.     public function setBlz($blz)
  1129.     {
  1130.         $this->blz $blz;
  1131.         return $this;
  1132.     }
  1133.     /**
  1134.      * Get blz
  1135.      *
  1136.      * @return string
  1137.      */
  1138.     public function getBlz()
  1139.     {
  1140.         return $this->blz;
  1141.     }
  1142.     /**
  1143.      * Set verkaeufer
  1144.      *
  1145.      * @param boolean $verkaeufer
  1146.      * @return Kunde
  1147.      */
  1148.     public function setVerkaeufer($verkaeufer)
  1149.     {
  1150.         $this->verkaeufer = (bool) $verkaeufer;
  1151.         return $this;
  1152.     }
  1153.     /**
  1154.      * Get verkaeufer
  1155.      *
  1156.      * @return boolean
  1157.      */
  1158.     public function getVerkaeufer()
  1159.     {
  1160.         return $this->verkaeufer;
  1161.     }
  1162.     /**
  1163.      * Auswahlbereich für ein Prüfungsdatum. Bei Verkaüfern und Kunden von Prüfungsämtern ohne Vollbestand darf das
  1164.      * Prüfungsdatum auch in der Vergangenheit liegen.
  1165.      *
  1166.      * @return string
  1167.      */
  1168.     public function getDatepickerClass()
  1169.     {
  1170.         if ($this->verkaeufer || $this->betrag_strafe) {
  1171.             return 'free';
  1172.         } else {
  1173.             return 'future';
  1174.         }
  1175.     }
  1176.     /**
  1177.      * Set iban
  1178.      *
  1179.      * @param string $iban
  1180.      * @return Kunde
  1181.      */
  1182.     public function setIban($iban)
  1183.     {
  1184.         $this->iban $iban;
  1185.         return $this;
  1186.     }
  1187.     /**
  1188.      * Get iban
  1189.      *
  1190.      * @return string
  1191.      */
  1192.     public function getIban()
  1193.     {
  1194.         return $this->iban;
  1195.     }
  1196.     /**
  1197.      * Set bic
  1198.      *
  1199.      * @param string $bic
  1200.      * @return Kunde
  1201.      */
  1202.     public function setBic($bic)
  1203.     {
  1204.         $this->bic $bic;
  1205.         return $this;
  1206.     }
  1207.     /**
  1208.      * Get bic
  1209.      *
  1210.      * @return string
  1211.      */
  1212.     public function getBic()
  1213.     {
  1214.         return $this->bic;
  1215.     }
  1216.     /**
  1217.      * Set sms_status_id
  1218.      *
  1219.      * @param integer $smsStatusId
  1220.      * @return Kunde
  1221.      */
  1222.     public function setSmsStatusId($smsStatusId)
  1223.     {
  1224.         $this->sms_status_id $smsStatusId;
  1225.         return $this;
  1226.     }
  1227.     /**
  1228.      * Get sms_status_id
  1229.      *
  1230.      * @return integer
  1231.      */
  1232.     public function getSmsStatusId()
  1233.     {
  1234.         return $this->sms_status_id;
  1235.     }
  1236.     /**
  1237.      *
  1238.      * @param string $message
  1239.      * @return \JF\JuridicusBundle\Entity\Kunde
  1240.      */
  1241.     public function setSmsStatusMessage($message)
  1242.     {
  1243.         $this->sms_status_message $message;
  1244.         return $this;
  1245.     }
  1246.     /**
  1247.      *
  1248.      * @return string
  1249.      */
  1250.     public function getSmsStatusMessage()
  1251.     {
  1252.         return $this->sms_status_message;
  1253.     }
  1254.     /**
  1255.      * Set betrag_strafe
  1256.      *
  1257.      * @param float $betragStrafe
  1258.      * @return Kunde
  1259.      */
  1260.     public function setBetragStrafe($betragStrafe)
  1261.     {
  1262.         $this->betrag_strafe $betragStrafe;
  1263.         return $this;
  1264.     }
  1265.     /**
  1266.      * Get betrag_strafe
  1267.      *
  1268.      * @return float
  1269.      */
  1270.     public function getBetragStrafe()
  1271.     {
  1272.         return $this->betrag_strafe;
  1273.     }
  1274.     /**
  1275.      * Set strafe_bezahlt
  1276.      *
  1277.      * @param boolean $strafeBezahlt
  1278.      * @return Kunde
  1279.      */
  1280.     public function setStrafeBezahlt($strafeBezahlt)
  1281.     {
  1282.         $this->strafe_bezahlt = (bool) $strafeBezahlt;
  1283.         $rechnung $this->getRechnungOhneBuchung(Gebuehr::TYP_STRAFGEBUEHR);
  1284.         if ($rechnung) {
  1285.             $rechnung->setBezahlt($this->strafe_bezahlt $this->betrag_strafe 0.0);
  1286.         }
  1287.         return $this;
  1288.     }
  1289.     /**
  1290.      * Get strafe_bezahlt
  1291.      *
  1292.      * @return boolean
  1293.      */
  1294.     public function getStrafeBezahlt()
  1295.     {
  1296.         return $this->strafe_bezahlt;
  1297.     }
  1298.     /**
  1299.      * Add rechnung
  1300.      *
  1301.      * @param \JF\JuridicusBundle\Entity\Rechnung $rechnung
  1302.      * @return Kunde
  1303.      */
  1304.     public function addRechnungen(Rechnung $rechnung)
  1305.     {
  1306.         $this->rechnungen[] = $rechnung;
  1307.         return $this;
  1308.     }
  1309.     /**
  1310.      * Remove rechnung
  1311.      *
  1312.      * @param \JF\JuridicusBundle\Entity\Rechnung $rechnung
  1313.      */
  1314.     public function removeRechnungen(Rechnung $rechnung)
  1315.     {
  1316.         $this->rechnungen->removeElement($rechnung);
  1317.     }
  1318.     /**
  1319.      * Get rechnungen
  1320.      *
  1321.      * @return \Doctrine\Common\Collections\Collection
  1322.      */
  1323.     public function getRechnungen()
  1324.     {
  1325.         return $this->rechnungen;
  1326.     }
  1327.     /**
  1328.      *
  1329.      *
  1330.      * @param integer $gebuehr_typ
  1331.      * @return Rechnung|null
  1332.      */
  1333.     public function getRechnungOhneBuchung($gebuehr_typ)
  1334.     {
  1335.         foreach ($this->getRechnungen() as $rechnung) {
  1336.             /* @var $rechnung \JF\JuridicusBundle\Entity\Rechnung */
  1337.             if ($rechnung->getTyp() == $gebuehr_typ && ! $rechnung->getBuchung()) {
  1338.                 return $rechnung;
  1339.             }
  1340.         }
  1341.         return null;
  1342.     }
  1343.     /**
  1344.      * Set sperrdatum
  1345.      *
  1346.      * @param \DateTime $sperrdatum
  1347.      * @return Kunde
  1348.      */
  1349.     public function setSperrdatum(\DateTime $sperrdatum null)
  1350.     {
  1351.         $this->sperrdatum $sperrdatum;
  1352.         return $this;
  1353.     }
  1354.     /**
  1355.      * Get sperrdatum
  1356.      *
  1357.      * @return \DateTime
  1358.      */
  1359.     public function getSperrdatum()
  1360.     {
  1361.         return $this->sperrdatum;
  1362.     }
  1363.     /**
  1364.      * Set pdf_need_update
  1365.      *
  1366.      * @param boolean $pdfNeedUpdate
  1367.      * @return Kunde
  1368.      */
  1369.     public function setPdfNeedUpdate($pdfNeedUpdate true)
  1370.     {
  1371.         $this->pdf_need_update = (bool) $pdfNeedUpdate;
  1372.         return $this;
  1373.     }
  1374.     /**
  1375.      * Get pdf_need_update
  1376.      *
  1377.      * @return boolean
  1378.      */
  1379.     public function getPdfNeedUpdate()
  1380.     {
  1381.         return $this->pdf_need_update;
  1382.     }
  1383.     /**
  1384.      * Set abo
  1385.      *
  1386.      * @param \JF\JuridicusBundle\Entity\Abo $abo
  1387.      * @return Kunde
  1388.      */
  1389.     public function setAbo(Abo $abo null)
  1390.     {
  1391.         $this->abo $abo;
  1392.         return $this;
  1393.     }
  1394.     /**
  1395.      * Get abo
  1396.      *
  1397.      * @return \JF\JuridicusBundle\Entity\Abo
  1398.      */
  1399.     public function getAbo()
  1400.     {
  1401.         return $this->abo;
  1402.     }
  1403.     /**
  1404.      *
  1405.      * @return \JF\JuridicusBundle\Entity\Pruefungsamt|null
  1406.      */
  1407.     public function getPruefungsamt()
  1408.     {
  1409.         foreach($this->getBundesland()->getPruefungsaemter() as $pruefungsamt) {
  1410.             /* @var $pruefungsamt \JF\JuridicusBundle\Entity\Pruefungsamt */
  1411.             if ($pruefungsamt->getExamen() == $this->getExamen()) {
  1412.                 return $pruefungsamt;
  1413.             }
  1414.         }
  1415.         return null;
  1416.     }
  1417.     /**
  1418.      * Set klausurprotokollpflicht
  1419.      *
  1420.      * @param boolean $klausurprotokollpflicht
  1421.      * @return Kunde
  1422.      */
  1423.     public function setKlausurprotokollpflicht($klausurprotokollpflicht true)
  1424.     {
  1425.         $this->klausurprotokollpflicht = (bool) $klausurprotokollpflicht;
  1426.         return $this;
  1427.     }
  1428.     /**
  1429.      * Get klausurprotokollpflicht
  1430.      *
  1431.      * @return boolean
  1432.      */
  1433.     public function getKlausurprotokollpflicht()
  1434.     {
  1435.         return $this->klausurprotokollpflicht;
  1436.     }
  1437.     /**
  1438.      * Set pflicht_facebook_post
  1439.      *
  1440.      * @param boolean $pflichtFacebookPost
  1441.      * @return Kunde
  1442.      */
  1443.     public function setPflichtFacebookPost($pflichtFacebookPost true)
  1444.     {
  1445.         $this->pflicht_facebook_post = (bool) $pflichtFacebookPost;
  1446.         return $this;
  1447.     }
  1448.     /**
  1449.      * Get pflicht_facebook_post
  1450.      *
  1451.      * @return boolean
  1452.      */
  1453.     public function getPflichtFacebookPost()
  1454.     {
  1455.         return $this->pflicht_facebook_post;
  1456.     }
  1457.     /**
  1458.      * Set notenpflicht
  1459.      *
  1460.      * @param boolean $notenpflicht
  1461.      * @return \JF\JuridicusBundle\Entity\Kunde
  1462.      */
  1463.     public function setNotenpflicht($notenpflicht true)
  1464.     {
  1465.         $this->notenpflicht = (bool) $notenpflicht;
  1466.         return $this;
  1467.     }
  1468.     /**
  1469.      * Get notenpflicht
  1470.      *
  1471.      * @return boolean
  1472.      */
  1473.     public function getNotenpflicht()
  1474.     {
  1475.         return $this->notenpflicht;
  1476.     }
  1477.     
  1478.     /**
  1479.      * Virtuelles Feld für Admin-Bereich
  1480.      */
  1481.     public function getImpersonating(): string
  1482.     {
  1483.         return '';
  1484.     }
  1485.     
  1486.     public function isFertig(): bool
  1487.     {
  1488.         return false;
  1489.     }
  1490. }