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

class ComboboxDozenten extends Combobox
{
  protected function getDatamodulAry()
  {
    if (!isset($this->dataModul)) {
      return array();
    }
    $db = new DBWorkDozenten(1, true);

    $knr = $this->dataModul->id;

    return $db->getDozenten4Kurs($knr);
  }

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

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

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

    return $option;
  }
}