if (($this->batchSize > 0)) {
$this->query->range($this->batch * $this->batchSize, $this->batchSize);
}
- return new \IteratorIterator($this->query->execute());
+ $statement = $this->query->execute();
+ $statement->setFetchMode(\PDO::FETCH_ASSOC);
+ return new \IteratorIterator($statement);
}
/**
* {@inheritdoc}
*/
public function count($refresh = FALSE) {
- return $this->query()->countQuery()->execute()->fetchField();
+ return (int) $this->query()->countQuery()->execute()->fetchField();
}
/**