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

class ComboboxUeGehalten extends Combobox
{
  protected function getDatamodulAry(): array
  {
    $vereinbarterUmfang = new class() extends Datamodul {
      public $value;
      public $text;
    };
    $vereinbarterUmfang->value = 1;
    $vereinbarterUmfang->text = 'im vereinbarten Umfang';

    $anders = new class() extends Datamodul {
      public $value;
      public $text;
    };
    $anders->value = 2;
    $anders->text = 'anders';

    return array(
          $vereinbarterUmfang,
          $anders);
  }

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

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

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

    return $option;
  }
}