0

I've got this thing which I don't know what it is, an object, a collection... that I am trying to parse. It's the output of below code (response of an Uploadcare PHP API request):

$fileListResponse = $api->file()->listFiles();
$fileCollection = $fileListResponse->getResults();

As you can see in the screenshot below the children are -inner, -api and #elements. The children of the nodes of #elements also have -api and -inner.

When I try the following:

foreach ($fileCollection->elements as $thing) {
    ...
}

I get the error:

Cannot access protected property Uploadcare\FileCollection::$elements

How can I iterate through the elements?

enter image description here

bart
  • 14,958
  • 21
  • 75
  • 105

0 Answers0