使用短信网关结果对象

use smsgateway result object

我正在关注这个 link send sms with smsgateway php

并获得成功响应。但无法获得结果 object->id 。示例结果对象如下所示

SMSGatewayMe\Client\Model\Device Object
(
[id:protected] => 1
[name:protected] => Device Name
[attributes:protected] => SMSGatewayMe\Client\Model\DeviceAttributes Object
    (
        [phoneNumber:protected] => 07791064781
        [make:protected] => samsung
        [model:protected] => SM-G965F
        [provider:protected] => EE
        [country:protected] => gb
        [connectionType:protected] => 4G
        [battery:protected] => 43
        [signalPercent:protected] =>
        [wifi:protected] =>
        [lat:protected] => 52.6076925
        [lng:protected] => -0.2046643
        [lastSeen:protected] => DateTime Object
            (
                [date] => 2018-05-14 17:36:20.000000
                [timezone_type] => 1
                [timezone] => +00:00
            )

    )

)

提前致谢

根据我从库中看到的,您需要调用 getId

$device->getId();

对于 属性 的其余部分,您使用 getPropertyName

more info