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

namespace Kufer\KuferTools\Utils\ResponseStrategies;


class ResponseAdresseOnCurrentPage extends ResponseStrategy
{
  public function extendResponse($pResponse)
  {
    $pResponse->adresse = $this->getAdresse($pResponse);

    return $pResponse;
  }

  private function getAdresse($pResponse)
  {
    $adrNummernDerSeite = $pResponse->blaettern->getItemsOnCurrentPage();
    $dbwAdresse = new \DBWorkAdresse(1, true);

    return $dbwAdresse->getAdressenByIDArray($adrNummernDerSeite);
  }
}