classes/Connection.php
public function fetch($query, ...$data)
    {
        if ($data) {
            $query = $this->merge($query, $data);
        }

        try {
            $statement = $this->pdo->query($query);

            return new FetchedResult($statement->fetchAll(PDO::FETCH_ASSOC));
        } catch (PDOException $exception) {
            throw new QueryException($exception, $query);
        }
    }
public function fetch($query, ...$data)
    {
        if ($data) {
            $query = $this->merge($query, $data);
        }

        try {
            $statement = $this->pdo->query($query);

            return new FetchedResult($statement->fetchAll(PDO::FETCH_ASSOC));
        } catch (PDOException $exception) {
            throw new QueryException($exception, $query);
        }
    }
public function fetch ( $ query , ... $ data ) { if ( $ data ) { $ query = $ this -> merge ( $ query , $ data ) ; } try { $ statement = $ this -> pdo -> query ( $ query ) ; return new FetchedResult ( $ statement -> fetchAll ( PDO :: FETCH_ASSOC ) ) ; } catch ( PDOException $ exception ) { throw new QueryException ( $ exception , $ query ) ; } }
Run a query and eagerly fetch the result into memory

Allows the result to be used more than once, for example when you
want to count the result and then iterate over it. Normally the
result would be entirely consumed after counting its rows.

@param string $query
@param mixed  ...$data
@return FetchedResult
@throws QueryException
Run a query and eagerly fetch the result into memory