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

class ComboboxBezirk extends Combobox
{
  protected function getDatamodulAry()
  {
    $db = new DBWorkHLGemeinde(1, true);
    $bezirke = $db->getBezirke();

    return $db->wandleBezirkeInDatamoduleUm($bezirke);
  }

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

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

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

    return $option;
  }
}