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

class ComboboxGeschlecht extends Combobox
{
  protected function getDatamodulAry(): array
  {
    $dbwGeschlecht = new DBWorkGeschlecht(1, true);

    return $dbwGeschlecht->getGeschlechter();
  }

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

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

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

    return $option;
  }
}