<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, 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()
  {
    $dbwTitel = new \DBWorkTitel();

    return $dbwTitel->getTitles();
  }

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

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

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

    return $option;
  }
}