Skip to content

Commit 8f1872d

Browse files
ziaratbansamdark
andauthored
Update src/Query.php
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
1 parent c1dbe3f commit 8f1872d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Query.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ public function buildCursor($db = null)
212212
*/
213213
protected function fetchRows($all = true, $indexBy = null, $db = null)
214214
{
215-
$db = $db === null ? yii::$app->mongodb : $db;
215+
if ($db === null) {
216+
$db = Yii::$app->get('mongodb');
217+
}
216218
$cursor = $this->buildCursor($db);
217219
$token = 'fetch cursor id = ' . $cursor->getId();
218220
if($db->enableLogging)

0 commit comments

Comments
 (0)