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

namespace Kufer\Web\KuferTools\Dozent\SammelVertraege\AkzeptierenOderAblehnen\Formular;


abstract class SammelVertraegeAkzeptierenOderAblehnenView extends \Kufer\Web\KuferTools\Basis\View\ViewSight
{
  protected function getDefaultDataModulArray()
  {
    $result = $this->viewModel->sammelvertraege;
    $result->showInput = $this->viewModel->showInput;
    $result->additionalInfo = $this->viewModel->additionalInfo;
    $result->wortSingular = $this->viewModel->wortSingular;
    $result->wortPlural = $this->viewModel->wortPlural;

    return array($result);
  }

  protected function getBodyDataModulArray()
  {
    return array_map(function(\Kurs $kurs) {
      $kurs->checkedForSammelVertraege = in_array($kurs->id, $this->viewModel->kursIds, true);

      return $kurs;
    }, $this->viewModel->kurse);
  }

  protected function getBodyExportAdapter()
  {
    return new \ExpKurse(true);
  }
}