Skip to content

Commit 102dd2f

Browse files
bencarrrdplewis
authored andcommitted
Ability to pass the decodeObjects boolean through to find in the first method (#441)
1 parent 68a65ec commit 102dd2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Parse/ParseQuery.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,14 @@ public function _getOptions()
499499
* Execute a query to get only the first result.
500500
*
501501
* @param bool $useMasterKey If the query should use the master key
502+
* @param bool $decodeObjects If set to false, will not return raw data instead of ParseObject instances
502503
*
503504
* @return array|ParseObject Returns the first object or an empty array
504505
*/
505-
public function first($useMasterKey = false)
506+
public function first($useMasterKey = false, $decodeObjects = true)
506507
{
507508
$this->limit = 1;
508-
$result = $this->find($useMasterKey);
509+
$result = $this->find($useMasterKey, $decodeObjects);
509510
if (count($result)) {
510511
return $result[0];
511512
} else {

0 commit comments

Comments
 (0)