Skip to content

Commit

Permalink
Merge pull request parse-community#93 from ParsePlatform/gFosco.count…
Browse files Browse the repository at this point in the history
…-sessiontoken

Added sessionToken to the count() query.
  • Loading branch information
gfosco committed Apr 15, 2015
2 parents a192709 + a08a544 commit ad2aab6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Parse/ParseQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,17 @@ private function buildQueryString($queryOptions)
*/
public function count($useMasterKey = false)
{
$sessionToken = null;
if (ParseUser::getCurrentUser()) {
$sessionToken = ParseUser::getCurrentUser()->getSessionToken();
}
$this->limit = 0;
$this->count = 1;
$queryString = $this->buildQueryString($this->_getOptions());
$result = ParseClient::_request(
'GET',
'/1/classes/'.$this->className.
'?'.$queryString, null, null, $useMasterKey
'?'.$queryString, $sessionToken, null, $useMasterKey
);

return $result['count'];
Expand Down

0 comments on commit ad2aab6

Please sign in to comment.