从对象内的数组中获取数组键(受保护的)值(来自RTM-php的响应)


Getting array key(protected)-value from an array inside object (response from RTM-php)?

当使用php库的RTM (https://github.com/bartosz-maciaszek/php-rtm)时,我得到一个特定任务列表的响应,如下所示:

Rtm'DataContainer Object
(
    [attributes:Rtm'DataContainer:private] => Array
        (
            [0] => Rtm'DataContainer Object
                (
                    [attributes:Rtm'DataContainer:private] => Array
                        (
                            [id] => 19594773
                            [taskseries] => Rtm'DataContainer Object
                                (
                                    [attributes:Rtm'DataContainer:private] => Array
                                        (
                                            [id] => 310899576
                                            [created] => 2013-10-03T05:35:52Z
                                            [modified] => 2013-11-06T17:24:36Z
                                            [name] => A new task
                                            [source] => js
                                            [url] => 
                                            [location_id] =>
                                        )
                                )
                        )
              )
      )
)

我想要得到[name]的值。我该怎么做呢?

据我所知,从文档中,您必须调用类似

的东西
$receivedObject->getTaskSeries()->getName()

或者有一个建议应用toArray或toJson返回的对象-应该工作