parse-community / parse-php-sdk

The PHP SDK for Parse Platform
https://parseplatform.org/
Other
811 stars 346 forks source link

Support query with count #448

Closed dplewis closed 5 years ago

dplewis commented 5 years ago

See https://github.com/parse-community/Parse-SDK-JS/pull/868

$query->withCount();
$response = $query->find();
$response['count'] // total number of objects despite limit / skip
$response['results'] // Array of objects

As of PHP 7.1 you can use Array Destructuring like es6

['count' => $count, 'results' => $results] = $query->find();
$count // total
$results // array