Queries can be created either by using the builder pattern, or by providing
a Query
when creating this object.
Example:
use Google\Cloud\ServiceBuilder;
$cloud = new ServiceBuilder();
$datastore = $cloud->datastore();
$query = $datastore->query();
$query->kind('Person');
$query->filter('firstName', 'Bob');
$result = $datastore->runQuery($query);
Queries can also be constructed using a Query Object:
$query = $datastore->query([
'query' => [
'kind' => [
[
'name' => 'People'
]
],
'filter' => [
'propertyFilter' => [
'op' => 'EQUAL',
'property' => [
'name' => 'firstName'
],
'value' => [
'stringValue': 'Bob'
]
]
]
]
]);
$result = $datastore->runQuery($query);