Datastore/src/TransactionTrait.php
public function runQuery(QueryInterface $query, array $options = [])
    {
        return $this->operation->runQuery($query, $options + [
            'transaction' => $this->transactionId
        ]);
    }
public function runQuery(QueryInterface $query, array $options = [])
    {
        return $this->operation->runQuery($query, $options + [
            'transaction' => $this->transactionId
        ]);
    }
public function runQuery ( QueryInterface $ query , array $ options = [ ] ) { return $ this -> operation -> runQuery ( $ query , $ options + [ 'transaction' => $ this -> transactionId ] ) ; }
Run a query and return entities inside a Transaction

Example:
```
$result = $transaction->runQuery($query);

foreach ($result as $entity) {
echo $entity['firstName'];
}
```

@param QueryInterface $query The query object.
@param array $options [optional] {
Configuration Options

@type string $className The name of the class to return results as.
Must be a subclass of {@see Google\Cloud\Datastore\Entity}.
If not set, {@see Google\Cloud\Datastore\Entity} will be used.
}
@return EntityIterator<EntityInterface>
Run a query and return entities inside a Transaction