Browse Source

#10023. Fix codeclimate issue

tags/2.0.23
Alexander Kartavenko 5 years ago
parent
commit
4bee9a4ed9
  1. 14
      framework/db/BatchQueryResult.php

14
framework/db/BatchQueryResult.php

@ -135,6 +135,7 @@ class BatchQueryResult extends BaseObject implements \Iterator
/** /**
* Fetches the next batch of data. * Fetches the next batch of data.
* @return array the data fetched * @return array the data fetched
* @throws Exception
*/ */
protected function fetchData() protected function fetchData()
{ {
@ -142,6 +143,17 @@ class BatchQueryResult extends BaseObject implements \Iterator
$this->_dataReader = $this->query->createCommand($this->db)->query(); $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 = []; $rows = [];
$count = 0; $count = 0;
@ -155,7 +167,7 @@ class BatchQueryResult extends BaseObject implements \Iterator
} }
} }
return $this->query->populate($rows); return $rows;
} }
/** /**

Loading…
Cancel
Save