mirror of
https://github.com/silverstripe/silverstripe-sqlite3
synced 2024-10-22 15:05:37 +00:00
add return type, remove unecessary reset
This commit is contained in:
parent
52e29831bc
commit
c77d1c2080
@ -56,14 +56,13 @@ class SQLite3Query extends Query
|
|||||||
/**
|
/**
|
||||||
* @todo This looks terrible but there is no SQLite3::get_num_rows() implementation
|
* @todo This looks terrible but there is no SQLite3::get_num_rows() implementation
|
||||||
*/
|
*/
|
||||||
private function countRecords()
|
private function countRecords(): int
|
||||||
{
|
{
|
||||||
// Some queries are not iterable using fetchArray like CREATE statement
|
// Some queries are not iterable using fetchArray like CREATE statement
|
||||||
if (!$this->handle->numColumns()) {
|
if (!$this->handle->numColumns()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->handle->reset();
|
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while ($this->handle->fetchArray()) {
|
while ($this->handle->fetchArray()) {
|
||||||
$c++;
|
$c++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user