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

namespace Kufer\KuferTools\Utils\WssField;

class WssFieldKursVeranstalter extends WssField
{
  protected function getValue($dataModulWert, $isFormular = false)
  {
    $knr = $dataModulWert->getVarValueEx('id', 'kurs');

    $dbwDozenten = new \DBWorkDozenten(1, true);
    $veranstalter = $dbwDozenten->getDozenten4KursMitTyp($knr, array('F'));

    if (count($veranstalter) > 0) {
      return $veranstalter[0]->getVarValue('titel_name_vorname');
    }

    return '';
  }
}