Ga_Lib_Api_Client.php
9 years ago
Ga_Lib_Api_Request.php
9 years ago
Ga_Lib_Api_Response.php
9 years ago
Ga_Lib_Api_Response.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | class Ga_Lib_Api_Response { |
| 4 | |
| 5 | public static $empty_response = array( '', '' ); |
| 6 | |
| 7 | private $header; |
| 8 | private $body; |
| 9 | private $data; |
| 10 | |
| 11 | function __construct( $raw_response ) { |
| 12 | $this->setHeader( $raw_response[0] ); |
| 13 | $this->setBody( $raw_response[1] ); |
| 14 | $this->setData( json_decode( $raw_response[1], true ) ); |
| 15 | } |
| 16 | |
| 17 | public function setHeader( $header ) { |
| 18 | $this->header = $header; |
| 19 | } |
| 20 | |
| 21 | public function getHeader() { |
| 22 | return $this->header; |
| 23 | } |
| 24 | |
| 25 | public function setBody( $body ) { |
| 26 | $this->body = $body; |
| 27 | } |
| 28 | |
| 29 | public function getBody() { |
| 30 | return $this->body; |
| 31 | } |
| 32 | |
| 33 | public function setData( $data ) { |
| 34 | $this->data = $data; |
| 35 | } |
| 36 | |
| 37 | public function getData() { |
| 38 | return $this->data; |
| 39 | } |
| 40 | } |