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

namespace Kufer\Web\KuferTools\Basis\Raumbelegung\Raumdetails\Detailsreiter\Kurse;

use Kufer\Web\KuferTools\Basis\View\DetailsTabelleRowView;
use Kufer\Web\KuferTools\Basis\View\DetailsTabelleRowViewModel;

abstract class ReiterKursePresenter extends \Kufer\Web\KuferTools\Basis\Raumbelegung\Raumdetails\Detailsreiter\Termine\ReiterTerminePresenter
{
  
  abstract protected function setModelKursAttribute4Links($pViewModel);

  
  protected function getEmptyDataObj()
  {
    
    $dbwObj = new \DBWorkKurseWT();

    return $dbwObj->getNewObject();
  }

  
  protected function getAnderenContent($datamodul, $key): string
  {
    $isHeader = empty($datamodul->id);
    $viewDetailsModel = new KursRowViewModel();
    $viewDetailsModel->isHeader = $isHeader;
    $viewDetailsModel->kurs = $datamodul;
    
    $viewDetailsModel->kurs->linkZuKursdetails = $this->getLinkZuKursdetails($datamodul);
    $this->setModelKursAttribute4Links($viewDetailsModel);
    $viewDetails = $this->getView4AnderenContent($viewDetailsModel);

    $viewModel = new DetailsTabelleRowViewModel(
      $this->useCaseResponse->toolSection,
      $this->useCaseResponse->toolSettings,
      true,
      $isHeader,
      trim($viewDetails->getHeader()),
      $this->getHyperlink4Columns($datamodul, $this->useCaseResponse->columns),
      $datamodul->id,
      $datamodul
    );

    $viewModel->useReplacementTableContentHeader = true;
    $viewModel->replacementTableContentHeader = trim($viewDetails->getHeader());
    $viewModel->useReplacmentTableContent = true;
    $viewModel->replacementTableContent = trim($viewDetails->getNoData());

    $view = new DetailsTabelleRowView($viewModel);

    return $view->show();
  }

  
  protected function isAdressLink($pColumn)
  {
  }

  
  protected function setColumnHyperLink($pDatamodul, $pColumn)
  {
  }
}