cert
8 years ago
Ga_Lib_Api_Client.php
5 years ago
Ga_Lib_Api_Request.php
5 years ago
Ga_Lib_Api_Response.php
9 years ago
Ga_Lib_Google_Api_Client.php
9 years ago
Ga_Lib_Sharethis_Api_Client.php
5 years ago
Ga_Lib_Api_Response.php
43 lines
| 1 | <?php |
| 2 | |
| 3 | class Ga_Lib_Api_Response { |
| 4 | |
| 5 | public static $empty_response = array( '', '' ); |
| 6 | private $header; |
| 7 | private $body; |
| 8 | private $data; |
| 9 | |
| 10 | function __construct( $raw_response = null ) { |
| 11 | if (!empty($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 | |
| 18 | public function setHeader( $header ) { |
| 19 | $this->header = $header; |
| 20 | } |
| 21 | |
| 22 | public function getHeader() { |
| 23 | return $this->header; |
| 24 | } |
| 25 | |
| 26 | public function setBody( $body ) { |
| 27 | $this->body = $body; |
| 28 | } |
| 29 | |
| 30 | public function getBody() { |
| 31 | return $this->body; |
| 32 | } |
| 33 | |
| 34 | public function setData( $data ) { |
| 35 | $this->data = $data; |
| 36 | } |
| 37 | |
| 38 | public function getData() { |
| 39 | return $this->data; |
| 40 | } |
| 41 | |
| 42 | } |
| 43 |