How i can access to private data PHP?

I have this problem Fatal error: Cannot access private property backendless\model\BackendlessCollection::$data.
How i can access to data?
Thanks

Can you show your code that uses our API?

Yes,


use backendless\services\persistence\BackendlessDataQuery;
use backendless\Backendless;
include "backendless/autoload.php";


    
Backendless::initApp('MY-APP-KEY,'MY-REST-KEY', 'v1');
  
$query = new BackendlessDataQuery();
 
$query->setWhereClause('codigoEvento = 34');    
 
$result_collection = Backendless::$Persistence->of( 'Foto' )->find($query);
print_r($result_collection->data[0]);

Are you using the latest version of the SDK for PHP?

Hi Leandro,

You need to use getter methods, e.g. getAsObject()

Yes

How? Y need all objects to show in a slider

Do you have an example?

Backendless::$Persistence->of( ‘Foto’ )->find($query)->getAsObject()

thank you very much!!

Tried it error is trying to get property of a non-object. Dont know what to do

Please post it as a separate topic, so that we can investigate your problem solely. Also include the code you’re trying to use.