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

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