<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Oeffentlich\LoginAnfordern\Utils;

class NeuesLoginAnlegenTeilnehmerLdapPassauBistum extends NeuesLoginAnlegenTeilnehmer
{
  
  private $postalCode;
  
  private $postalAddress;
  
  private $department;
  
  private $telephoneNumber;
  
  private $streetAddress;

  
  
  public function __construct(string $postalCode, string $postalAddress, string $department, string $telephoneNumber, string $streetAddress)
  {
    $this->postalCode = $postalCode;
    $this->postalAddress = $postalAddress;
    $this->department = $department;
    $this->telephoneNumber = $telephoneNumber;
    $this->streetAddress = $streetAddress;
  }

  protected function getPersonObj(string $pGeschlecht, string $pName, string $pVorname, string $pEmail, string $pDseUnterschriebenDatum): \Personn
  {
    $result = parent::getPersonObj($pGeschlecht, $pName, $pVorname, $pEmail, $pDseUnterschriebenDatum);
    $result->setValue2Var('abteilung', $this->department);
    $result->setValue2Var('ort', $this->postalCode . ' ' . $this->postalAddress);
    $result->setValue2Var('strasse', $this->streetAddress);
    $result->setValue2Var('tel', $this->telephoneNumber);
    $result->setValue2Var('tel_anzeige', $this->telephoneNumber);

    return $result;
  }
}