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