src/Koldy/Db/Query/Select.php
public function fetchAllGenerator(): Generator
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        $statement = $this->getAdapter()->getStatement();

        while ($record = $statement->fetch(PDO::FETCH_ASSOC)) {
            yield $record;
        }

        $statement->closeCursor();
    }
public function fetchAllGenerator(): Generator
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        $statement = $this->getAdapter()->getStatement();

        while ($record = $statement->fetch(PDO::FETCH_ASSOC)) {
            yield $record;
        }

        $statement->closeCursor();
    }
public function fetchAllGenerator ( ) : Generator { if ( ! $ this -> wasExecuted ( ) ) { $ this -> exec ( ) ; } $ statement = $ this -> getAdapter ( ) -> getStatement ( ) ; while ( $ record = $ statement -> fetch ( PDO :: FETCH_ASSOC ) ) { yield $ record ; } $ statement -> closeCursor ( ) ; }
Fetch all records by getting Generator back

@return Generator
@throws Exception
@throws \Koldy\Exception
Fetch all records by getting Generator back