aboutsummaryrefslogtreecommitdiff
path: root/includes/vendor/aura/sql/src/Iterator/AllIterator.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/vendor/aura/sql/src/Iterator/AllIterator.php')
-rw-r--r--includes/vendor/aura/sql/src/Iterator/AllIterator.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/includes/vendor/aura/sql/src/Iterator/AllIterator.php b/includes/vendor/aura/sql/src/Iterator/AllIterator.php
new file mode 100644
index 0000000..9d56a24
--- /dev/null
+++ b/includes/vendor/aura/sql/src/Iterator/AllIterator.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ *
+ * This file is part of Aura for PHP.
+ *
+ * @license http://opensource.org/licenses/bsd-license.php BSD
+ *
+ */
+namespace Aura\Sql\Iterator;
+
+use PDO;
+use PDOStatement;
+
+/**
+ *
+ * The iterator equivalent of `fetchAll()`.
+ *
+ * @package Aura.Sql
+ *
+ */
+class AllIterator extends AbstractIterator
+{
+ /**
+ *
+ * Constructor.
+ *
+ * @param PDOStatement $statement PDO statement.
+ *
+ */
+ public function __construct(PDOStatement $statement)
+ {
+ $this->statement = $statement;
+ $this->statement->setFetchMode(PDO::FETCH_ASSOC);
+ }
+
+ /**
+ *
+ * Fetches next row from statement.
+ *
+ */
+ public function next()
+ {
+ $this->row = $this->statement->fetch();
+ $this->key ++;
+ }
+}