From e45e4f326ba906bd270b17f3fd833a19a3bc36ec Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 10 Apr 2019 20:23:55 +0100 Subject: [PATCH] Ability to pass the decodeObjects boolean through to find in the first method --- src/Parse/ParseQuery.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Parse/ParseQuery.php b/src/Parse/ParseQuery.php index c36ced77..8e353c4d 100644 --- a/src/Parse/ParseQuery.php +++ b/src/Parse/ParseQuery.php @@ -485,13 +485,14 @@ public function _getOptions() * Execute a query to get only the first result. * * @param bool $useMasterKey If the query should use the master key + * @param bool $decodeObjects If set to false, will not return raw data instead of ParseObject instances * * @return array|ParseObject Returns the first object or an empty array */ - public function first($useMasterKey = false) + public function first($useMasterKey = false, $decodeObjects = true) { $this->limit = 1; - $result = $this->find($useMasterKey); + $result = $this->find($useMasterKey, $decodeObjects); if (count($result)) { return $result[0]; } else {