Пример #1
0
 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();
 }
Пример #2
0
 /**
  * @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();
 }