     1: <?php
     2:
     3: namespace SMSApi\Api\Response;
     4:
     5: /**
     6:  * Class SenderResponse
     7:  * @package SMSApi\Api\Response
     8:  */
     9: class SenderResponse extends AbstractResponse {
    10:
    11:     /**
    12:      * @var string
    13:      */
    14:     private $name;
    15:
    16:     /**
    17:      * @var string
    18:      */
    19:     private $status;
    20:
    21:     /**
    22:      * @var int
    23:      */
    24:     private $default;
    25:
    26:     /**
    27:      * @param $data
    28:      */
    29:     function __construct( $data ) {
    30:
    31:         if ( is_object( $data ) ) {
    32:             $this->obj = $data;
    33:         } else if ( is_string( $data ) ) {
    34:             parent::__construct( $data );
    35:         }
    36:
    37:         if( isset( $this->obj->sender ) ) {
    38:             $this->name = $this->obj->sender;
    39:         }
    40:
    41:         if( isset( $this->obj->status ) ) {
    42:             $this->status = $this->obj->status;
    43:         }
    44:
    45:         if( isset( $this->obj->default ) ) {
    46:             $this->default = $this->obj->default;
    47:         }
    48:     }
    49:
    50:     /**
    51:      * Is sender name is default selected.
    52:      *
    53:      * @return bool
    54:      */
    55:     public function isDefault() {
    56:         return (bool)$this->default;
    57:     }
    58:
    59:     /**
    60:      * Returns sender name.
    61:      *
    62:      * @return string
    63:      */
    64:     public function getName() {
    65:         return $this->name;
    66:     }
    67:
    68:     /**
    69:      * Returns status sender name.
    70:      *
    71:      * Example:
    72:      * ACTIVE INACTIVE
    73:      *
    74:      * @return string
    75:      */
    76:     public function getStatus() {
    77:         return $this->status;
    78:     }
    79:
    80: }
    81: