aboutsummaryrefslogtreecommitdiff
path: root/includes/vendor/aura/sql/src/Iterator/PairsIterator.php
diff options
context:
space:
mode:
authors1n <[email protected]>2020-03-28 10:36:41 -0700
committers1n <[email protected]>2020-03-28 10:36:41 -0700
commit25b7d2aab61ae6421398d3abae5da6ffe590333d (patch)
tree611985ec78bb2d94099c9fd5dd687f5c9cee6f3e /includes/vendor/aura/sql/src/Iterator/PairsIterator.php
parentInitial commit (diff)
downloadcrack.cf-backup-master.tar.xz
crack.cf-backup-master.zip
3/28/2020, 10:36HEADmaster
Diffstat (limited to 'includes/vendor/aura/sql/src/Iterator/PairsIterator.php')
-rw-r--r--includes/vendor/aura/sql/src/Iterator/PairsIterator.php50
1 files changed, 50 insertions, 0 deletions
diff --git a/includes/vendor/aura/sql/src/Iterator/PairsIterator.php b/includes/vendor/aura/sql/src/Iterator/PairsIterator.php
new file mode 100644
index 0000000..20c1a13
--- /dev/null
+++ b/includes/vendor/aura/sql/src/Iterator/PairsIterator.php
@@ -0,0 +1,50 @@
+<?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 `fetchPairs()`.
+ *
+ * @package Aura.Sql
+ *
+ */
+class PairsIterator extends AbstractIterator
+{
+ /**
+ *
+ * Constructor.
+ *
+ * @param PDOStatement $statement PDO statement.
+ *
+ */
+ public function __construct(PDOStatement $statement)
+ {
+ $this->statement = $statement;
+ $this->statement->setFetchMode(PDO::FETCH_NUM);
+ }
+
+ /**
+ *
+ * Fetches next row from statement.
+ *
+ */
+ public function next()
+ {
+ $this->key = false;
+ $this->row = $this->statement->fetch();
+ if ($this->row !== false) {
+ $this->key = $this->row[0];
+ $this->row = $this->row[1];
+ }
+ }
+}