public function fetchAll(int $fetchMode = null, array $driverOptions = []): array
    {
        try {
            if (null === $fetchMode) {
                return $this->pdoStatement->fetchAll();
            }

            if (PDO::FETCH_COLUMN == $fetchMode) {
                return $this->pdoStatement->fetchAll(
                        PDO::FETCH_COLUMN,
                        $driverOptions['columnIndex'] ?? 0
                );
            }

            if (PDO::FETCH_CLASS == $fetchMode) {
                if (!isset($driverOptions['classname'])) {
                    throw new \InvalidArgumentException('Tried to use PDO::FETCH_CLASS but no classname given in driver options.');
                }

                return $this->pdoStatement->fetchAll(
                        PDO::FETCH_CLASS,
                        $driverOptions['classname'],
                        $driverOptions['arguments'] ?? null
                );
            }

            if (PDO::FETCH_FUNC == $fetchMode) {
                if (!isset($driverOptions['function'])) {
                    throw new \InvalidArgumentException('Tried to use PDO::FETCH_FUNC but no function given in driver options.');
                }

                return $this->pdoStatement->fetchAll(
                        PDO::FETCH_FUNC,
                        $driverOptions['function']
                );
            }

            return $this->pdoStatement->fetchAll($fetchMode);
        } catch (PDOException $pdoe) {
            throw new DatabaseException($pdoe->getMessage(), $pdoe);
        }
    }
public function fetchAll(int $fetchMode = null, array $driverOptions = []): array
    {
        try {
            if (null === $fetchMode) {
                return $this->pdoStatement->fetchAll();
            }

            if (PDO::FETCH_COLUMN == $fetchMode) {
                return $this->pdoStatement->fetchAll(
                        PDO::FETCH_COLUMN,
                        $driverOptions['columnIndex'] ?? 0
                );
            }

            if (PDO::FETCH_CLASS == $fetchMode) {
                if (!isset($driverOptions['classname'])) {
                    throw new \InvalidArgumentException('Tried to use PDO::FETCH_CLASS but no classname given in driver options.');
                }

                return $this->pdoStatement->fetchAll(
                        PDO::FETCH_CLASS,
                        $driverOptions['classname'],
                        $driverOptions['arguments'] ?? null
                );
            }

            if (PDO::FETCH_FUNC == $fetchMode) {
                if (!isset($driverOptions['function'])) {
                    throw new \InvalidArgumentException('Tried to use PDO::FETCH_FUNC but no function given in driver options.');
                }

                return $this->pdoStatement->fetchAll(
                        PDO::FETCH_FUNC,
                        $driverOptions['function']
                );
            }

            return $this->pdoStatement->fetchAll($fetchMode);
        } catch (PDOException $pdoe) {
            throw new DatabaseException($pdoe->getMessage(), $pdoe);
        }
    }
public function fetchAll ( int $ fetchMode = null , array $ driverOptions = [ ] ) : array { try { if ( null === $ fetchMode ) { return $ this -> pdoStatement -> fetchAll ( ) ; } if ( PDO :: FETCH_COLUMN == $ fetchMode ) { return $ this -> pdoStatement -> fetchAll ( PDO :: FETCH_COLUMN , $ driverOptions [ 'columnIndex' ] ?? 0 ) ; } if ( PDO :: FETCH_CLASS == $ fetchMode ) { if ( ! isset ( $ driverOptions [ 'classname' ] ) ) { throw new \ InvalidArgumentException ( 'Tried to use PDO::FETCH_CLASS but no classname given in driver options.' ) ; } return $ this -> pdoStatement -> fetchAll ( PDO :: FETCH_CLASS , $ driverOptions [ 'classname' ] , $ driverOptions [ 'arguments' ] ?? null ) ; } if ( PDO :: FETCH_FUNC == $ fetchMode ) { if ( ! isset ( $ driverOptions [ 'function' ] ) ) { throw new \ InvalidArgumentException ( 'Tried to use PDO::FETCH_FUNC but no function given in driver options.' ) ; } return $ this -> pdoStatement -> fetchAll ( PDO :: FETCH_FUNC , $ driverOptions [ 'function' ] ) ; } return $ this -> pdoStatement -> fetchAll ( $ fetchMode ) ; } catch ( PDOException $ pdoe ) { throw new DatabaseException ( $ pdoe -> getMessage ( ) , $ pdoe ) ; } }
returns an array containing all of the result set rows

@param   int    $fetchMode      optional  the mode to use for fetching the data
@param   array  $driverOptions  optional  driver specific arguments
@return  array
@throws  \stubbles\db\DatabaseException
@throws  \InvalidArgumentException
@see     http://php.net/pdostatement-fetchAll
returns an array containing all of the result set rows