Google\Cloud\Datastore\Transaction::runQuery PHP Method

runQuery() public method

Example: $result = $transaction->runQuery($query); foreach ($result as $entity) { echo $entity['firstName']; }
public runQuery ( Google\Cloud\Datastore\Query\QueryInterface $query, array $options = [] ) : Generator
$query Google\Cloud\Datastore\Query\QueryInterface The query object.
$options array [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 Generator
    public function runQuery(QueryInterface $query, array $options = [])
    {
        return $this->operation->runQuery($query, $options + ['transaction' => $this->transactionId]);
    }