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

class ComboboxPersonAnredetitel extends Combobox
{
  
  public function __construct($datamodulName, $pSelectedValue = null, $pDataModul = null)
  {
    $pSelectedValue = $pDataModul->getVarValueEx('name_titel', $datamodulName);
    parent::__construct($pSelectedValue, $pDataModul);
  }

  protected function getDatamodulAry(): array
  {
    $dbwTitel = new \DBWorkTitel();

    return $dbwTitel->getTitles();
  }

  protected function getValueFieldName(): string
  {
    return 'name';
  }

  protected function getTextFieldName(): string
  {
    return 'name';
  }

  protected function getDefaultOption(): ?\ComboboxOption
  {
    $option = parent::getDefaultOption();
    $option->text = 'Kein Anredetitel';

    return $option;
  }
}