<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

class ComboboxGeschlechtAnrede extends Combobox
{
  protected function getDatamodulAry()
  {
    $result = array();

    $herrObj = new Geschlecht();
    $herrObj->id = 1;
    $herrObj->kurz = 'H';
    $herrObj->lang = 'Herr';

    $frauObj = new Geschlecht();
    $frauObj->id = 2;
    $frauObj->kurz = 'F';
    $frauObj->lang = 'Frau';

    array_push($result, $herrObj, $frauObj);

    return $result;
  }

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

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

  protected function getDefaultOption()
  {
    $option = new ComboboxOption();
    $option->value = '';
    $option->text = 'Geschlecht auswählen';
    $option->isSelected = is_null($this->selectedValue);

    return $option;
  }
}