public function __construct(Response $response) { parent::__construct(); $this->setStatusCode($response->getStatusCode(), $response->getStatusMessage()); $this->data = $response->getData(); $this->meta = $response->getMeta(); $this->messages = $response->getMessages(); }
/** * @param Response $controllerResponse */ public function __construct($controllerResponse) { if ($controllerResponse instanceof ResponseArray) { foreach ($controllerResponse->getResponses() as $response) { $this->records[] = $response->getData(); } } elseif ($controllerResponse instanceof Response) { $this->records[] = $controllerResponse->getData(); } parent::__construct(); }