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

runQuery() public method

To query datastore inside a transaction, use {@see \Google\Cloud\Datastore\Transaction::runQuery()}. Example: $result = $datastore->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 A 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. @type string $readConsistency See [ReadConsistency](https://cloud.google.com/datastore/reference/rest/v1/ReadOptions#ReadConsistency). }
return Generator
    public function runQuery(QueryInterface $query, array $options = [])
    {
        return $this->operation->runQuery($query, $options);
    }