/** * Constructor */ function __construct($data) { // If not array if (!is_array($data)) { // Set message $data = ['message' => $data]; } // Set attributes $this->setAttributes(Utilities::arrayExtract(['message_id', 'id', 'message_type', 'type', 'mobile_number', 'mobile', 'shortcode', 'request_id', 'request_cost', 'cost', 'message', 'timestamp'], $data)); }
/** * Constructor */ function __construct(array $data) { // Set attributes $this->setAttributes(Utilities::arrayExtract(['message_type', 'type', 'shortcode', 'message_id', 'id', 'status', 'credits_cost', 'credits', 'rb_cost', 'cost', 'timestamp'], $data)); }