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

namespace Kufer\Web\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);
  }
}