diff options
| author | s1n <[email protected]> | 2020-03-28 10:36:41 -0700 |
|---|---|---|
| committer | s1n <[email protected]> | 2020-03-28 10:36:41 -0700 |
| commit | 25b7d2aab61ae6421398d3abae5da6ffe590333d (patch) | |
| tree | 611985ec78bb2d94099c9fd5dd687f5c9cee6f3e /includes/vendor/aura/sql/src/Iterator/ColIterator.php | |
| parent | Initial commit (diff) | |
| download | crack.cf-backup-master.tar.xz crack.cf-backup-master.zip | |
Diffstat (limited to 'includes/vendor/aura/sql/src/Iterator/ColIterator.php')
| -rw-r--r-- | includes/vendor/aura/sql/src/Iterator/ColIterator.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/includes/vendor/aura/sql/src/Iterator/ColIterator.php b/includes/vendor/aura/sql/src/Iterator/ColIterator.php new file mode 100644 index 0000000..7be66e8 --- /dev/null +++ b/includes/vendor/aura/sql/src/Iterator/ColIterator.php @@ -0,0 +1,49 @@ +<?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 `fetchCol()`. + * + * @package Aura.Sql + * + */ +class ColIterator 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->row = $this->statement->fetch(); + if ($this->row !== false) { + $this->row = $this->row[0]; + } + $this->key ++; + } +} |