src/Db/Query.php
public function all($db = null)
    {
        if ($this->emulateExecution) {
            return new LazyPromise(function() { return resolve([]); });
        }
        return $this->createCommand($db)->queryAll()->thenLazy(
            function($results) {
                return $this->populate($results);
            }
        );
    }
public function all($db = null)
    {
        if ($this->emulateExecution) {
            return new LazyPromise(function() { return resolve([]); });
        }
        return $this->createCommand($db)->queryAll()->thenLazy(
            function($results) {
                return $this->populate($results);
            }
        );
    }
Executes the query and returns all results as an array.
@param DatabaseInterface|DbConnectionGetterInterface $db the database connection used to generate the SQL statement.
If this parameter is not given, the `db` application component will be used.
@return LazyPromiseInterface with array the query results. If the query results in nothing, an empty array will be returned.