Skip to content

Commit

Permalink
yiisoft#10023. Fix codeclimate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkart committed Jul 15, 2019
1 parent 25cf331 commit 4bee9a4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion framework/db/BatchQueryResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,25 @@ public function next()
/**
* Fetches the next batch of data.
* @return array the data fetched
* @throws Exception
*/
protected function fetchData()
{
if ($this->_dataReader === null) {
$this->_dataReader = $this->query->createCommand($this->db)->query();
}

$rows = $this->getRows();

return $this->query->populate($rows);
}

/**
* Reads and collects rows for batch
* @return array
*/
protected function getRows()
{
$rows = [];
$count = 0;

Expand All @@ -155,7 +167,7 @@ protected function fetchData()
}
}

return $this->query->populate($rows);
return $rows;
}

/**
Expand Down

0 comments on commit 4bee9a4

Please sign in to comment.