在 twilio sdk 5.x 版本中实现 getIterator 方法

implement getIterator method in version 5.x of twilio sdk

我在 twilio 版本中使用了以下代码 4.x:

$events = $this->client->workspace->events->getIterator(0, 50, array(
            'Minutes' => round((time() - strtotime('today')) / 60),
            'ResourceType' => 'Task'
        ));

我现在已经升级到5.x版本了。而且我不确定如何在 5.16 版中使用 getiterator。我尝试了几种方法,也尝试在互联网上寻找解决方案,但没有成功。有什么帮助吗?

我知道了。它应该通过这样的读取方法来完成:

$events = $this->client->taskrouter
            ->workspaces($this->workspaceSid)
            ->events->read(
                array('Minutes' => round((time() - strtotime('today')) / 60),'ResourceType' => 'Task'),
                50
            );

我以相反的方式为读取方法设置了参数,所以它之前不起作用。