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

namespace Kufer\KuferTools\Teilnehmer\BayerischerApothekertag\HandleAnmeldung;

class HandleAnmeldungPresenter extends \Kufer\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($pKurse, $pStatus)
  {
    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;
  }
}