     1: <?php
     2:
     3: namespace SMSApi\Api\Response;
     4:
     5: /**
     6:  * Class ErrorResponse
     7:  * @package SMSApi\Api\Response
     8:  */
     9: class ErrorResponse extends AbstractResponse {
    10:
    11:     /**
    12:      * @var int
    13:      */
    14:     public $code = 0;
    15:     /**
    16:      * @var string
    17:      */
    18:     public $message = "";
    19:
    20:     /**
    21:      * @param $data
    22:      */
    23:     function __construct( $data ) {
    24:         parent::__construct( $data );
    25:
    26:         if ( isset( $this->obj->error ) ) {
    27:             $this->code = $this->obj->error;
    28:         }
    29:
    30:         if ( isset( $this->obj->message ) ) {
    31:             $this->message = $this->obj->message;
    32:         }
    33:     }
    34:
    35:     /**
    36:      * @return bool
    37:      */
    38:     public function isError() {
    39:         return ($this->code != 0);
    40:     }
    41:
    42: }
    43:
    44: