public function __construct(Client $client, Api\Response $response) { $this->httpClient = $client->getHttpClient(); $resource = $response->toArray(); $params = $response->request->getParameters(); $this->firstPage = isset($params['page']) ? (int) max($params['page'], 1) : 1; $this->perPage = isset($params['per_page']) ? (int) $params['per_page'] : count($resource); $this->responses[$this->firstPage] = $response; $this->resources[$this->firstPage] = $resource; }
public function handleResponse() { $this->client->getUser(); // check the received parameters and save user $this->onResponse($this); $this->presenter->redirect('this', array('state' => NULL, 'code' => NULL)); }