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

namespace Kufer\Web\Classes\Api\Combobox;

class ComboboxStatus extends \Combobox
{
  protected function getDatamodulAry(): array
  {
    $dbwStatus = new \DBWorkHLStatusKZ(1, true);

    return $dbwStatus->getAll();
  }

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

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

  protected function getText($datamodul): string
  {
    return $datamodul->getVarValue('kennz') . ' - ' . $datamodul->getVarValue('text');
  }

  protected function getDefaultOption(): ?\ComboboxOption
  {
    return null;
  }
}