public function all($db = null)
    {
        if ($this->emulateExecution) {
            return resolve([]);
        }
        return $this->createCommand($db)->thenLazy(
            function(CommandInterface $command) {
                return $command->queryAll();
            }
        )->thenLazy(
            function($results) {
                return $this->populate($results);
            }
        );
    }
public function all($db = null)
    {
        if ($this->emulateExecution) {
            return resolve([]);
        }
        return $this->createCommand($db)->thenLazy(
            function(CommandInterface $command) {
                return $command->queryAll();
            }
        )->thenLazy(
            function($results) {
                return $this->populate($results);
            }
        );
    }
public function all ( $ db = null ) { if ( $ this -> emulateExecution ) { return resolve ( [ ] ) ; } return $ this -> createCommand ( $ db ) -> thenLazy ( function ( CommandInterface $ command ) { return $ command -> queryAll ( ) ; } ) -> thenLazy ( function ( $ results ) { return $ this -> populate ( $ results ) ; } ) ; }
Executes query and returns all results as an array.
@param DatabaseInterface|DbConnectionGetterInterface|null $db the DB connection used to create the DB command.
If null, the DB connection returned by [[modelClass]] will be used.
@return ExtendedPromiseInterface with array|ActiveRecordInterface[] the query results. If the query results in nothing, an empty array will be returned.
Executes query and returns all results as an array .