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

namespace Kufer\KuferTools\Utils\ResponseStrategies;


class ResponseVisitenkarteOnCurrentPage extends ResponseStrategy
{
  public function extendResponse($pResponse)
  {
    $pResponse->visitenkarten = $this->getVisitenkarten($pResponse);

    return $pResponse;
  }

  private function getVisitenkarten($pResponse)
  {
    $visitenkartenIdsDerSeite = $pResponse->blaettern->getItemsOnCurrentPage();
    $dbwVisitenkartenWeb = new \DBWorkVisitenkartenWeb(1, true);

    return $dbwVisitenkartenWeb->getVisitenkartenByIds($visitenkartenIdsDerSeite);
  }
}