Datastore/src/DatastoreClient.php
public function lookup(Key $key, array $options = [])
    {
        $res = $this->lookupBatch([$key], $options);

        return (isset($res['found'][0]))
            ? $res['found'][0]
            : null;
    }
public function lookup(Key $key, array $options = [])
    {
        $res = $this->lookupBatch([$key], $options);

        return (isset($res['found'][0]))
            ? $res['found'][0]
            : null;
    }
public function lookup ( Key $ key , array $ options = [ ] ) { $ res = $ this -> lookupBatch ( [ $ key ] , $ options ) ; return ( isset ( $ res [ 'found' ] [ 0 ] ) ) ? $ res [ 'found' ] [ 0 ] : null ; }
Retrieve an entity from the datastore

To lookup an entity inside a transaction, use
{@see Google\Cloud\Datastore\Transaction::lookup()}.

Example:
```
$key = $datastore->key('Person', 'Bob');

$entity = $datastore->lookup($key);
if (!is_null($entity)) {
echo $entity['firstName']; // 'Bob'
}
```

@see https://cloud.google.com/datastore/docs/reference/rest/v1/projects/lookup Lookup API documentation

@param Key $key The identifier to use to locate a desired entity.
@param array $options [optional] {
Configuration Options

@type string $readConsistency See
[ReadConsistency](https://cloud.google.com/datastore/reference/rest/v1/ReadOptions#ReadConsistency).
@type string $className If set, the given class will be returned.
Value must be the name of a class implementing
{@see Google\Cloud\Datastore\EntityInterface}. **Defaults to**
{@see Google\Cloud\Datastore\Entity}.
}
@return EntityInterface|null
Retrieve an entity from the datastore