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

namespace Kufer\Web\KuferTools\Dozent\KursUebersicht\Detailsreiter\Honorar\Vertrag\VertragAblehnen;

use Kufer\Web\KuferTools\Basis\Presenter\Presenter;

class VertragAblehnenDialogPresenter extends Presenter
{
  protected function getViewModel()
  {
    $result = new VertragAblehnenDialogViewModel();
    $result->kurs = $this->useCaseResponse->kurs;
    $result->mitBemerkung = $this->useCaseResponse->mitBemerkung;

    return $result;
  }

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

  public function setRequestHeader()
  {
    header('Content-Type: application/json');
    header('Content-language: de');
  }

  public function present()
  {
    $view = $this->getView();

    return \JsonOperations::encodeJustStrings(array(
      'title' => $view->getHeader(),
      'message' => $view->getBody(),
      'button' => $view->getFooter()
    ));
  }
}