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

namespace Kufer\KuferTools\Utils\WssField;

class WssFieldBelegungAustritt extends WssField
{
  protected function getValue($datamodulWert, $isFormular = false)
  {
    if (isset($datamodulWert->stornoShowAustrittFeld) && $datamodulWert->stornoShowAustrittFeld
            || \APIGebuehren::hasKursFortlaufendeGebuehren($datamodulWert->kurs->id)) {
      return '<input id="austritt_' . \CleanOperations::cleanInt($datamodulWert->id) . '" class="austritt val_date form-control" maxlength="10">';
    }

    return '';
  }

  protected function encodeValue($value)
  {
    return $this->dontEncode($value);
  }
}