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

class ComboboxZielgruppe extends Combobox
{
  protected function getDatamodulAry()
  {
    $dbw = new DBWorkZielgruppeProgrammheft(1, true);

    return $dbw->getZielgruppen();
  }

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

  protected function getTextFieldName()
  {
    return '';
  }

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

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

    return $option;
  }
}