Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ziaratban committed Jul 16, 2020
1 parent 2275449 commit dfe2aa5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,11 @@ public function buildCursor($db = null)
/**
* Fetches rows from the given Mongo cursor.
* @param bool $all whether to fetch all rows or only first one.
* @param string|callable $indexBy the column name or PHP callback,
* by which the query results should be indexed by.
* @param yii\mongodb\Connection $db the MongoDB connection used to fetch rows.
* @throws Exception on failure.
* @return array|bool result.
*/
protected function fetchRows($all = true, $indexBy = null, $db = null)
protected function fetchRows($all = true, $db = null)
{
if ($db === null) {
$db = Yii::$app->get('mongodb');
Expand Down Expand Up @@ -334,7 +332,7 @@ public function all($db = null)
if (!empty($this->emulateExecution)) {
return [];
}
$rows = $this->fetchRows(true, $this->indexBy, $db);
$rows = $this->fetchRows(true, $db);
return $this->populate($rows);
}

Expand Down

0 comments on commit dfe2aa5

Please sign in to comment.