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

namespace Kufer\Web\KuferTools\Teilnehmer\BayerischerApothekertag\HandleAnmeldung;

class HandleAnmeldungPresenter extends \Kufer\Web\KuferTools\Basis\Presenter\MitRahmenPresenter
{
  protected function getContent()
  {
    $view = $this->getView();
    if ($this->useCaseResponse->doppeltVersandt) {
      return $view->getNoColumn();
    }
    if ($this->useCaseResponse->userHasNoEmail) {
      return $view->getNoData();
    }

    return $this->getAnderenContentAlsBody($this->useCaseResponse->kurse);
  }

  protected function getAnderenContent($datamodul, $key): string
  {
    return '';
  }

  protected function getKurs($index, $datamodul)
  {
    $viewModel = new KursViewModel();
    $viewModel->index = $index;
    $viewModel->kurs = $datamodul;
    $kursView = new KursView($viewModel);

    return $kursView->show();
  }

  protected function getView()
  {
    return new HandleAnmeldungView($this->getViewModel());
  }

  protected function getViewModel()
  {
    $viewModel = new HandleAnmeldungViewModel();
    $viewModel->tndata = $this->useCaseResponse->tndata;
    $viewModel->agb = $this->useCaseResponse->agb;

    return $viewModel;
  }
}