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

key() public method

Example: $key = $datastore->key('Person', 'Bob'); To override the internal detection of identifier type, you can specify which type to use. $key = $datastore->key('Robots', '1337', [ 'identifierType' => Key::TYPE_NAME ]);
See also: https://cloud.google.com/datastore/reference/rest/v1/Key Key
See also: https://cloud.google.com/datastore/reference/rest/v1/Key#PathElement PathElement
public key ( string $kind, string | integer $identifier = null, array $options = [] ) : Key
$kind string The kind.
$identifier string | integer [optional] The ID or name.
$options array [optional] { Configuration Options @type string $identifierType If omitted, type will be determined internally. In cases where any ambiguity can be expected (i.e. if you want to create keys with `name` but your values may pass PHP's `is_numeric()` check), this value may be explicitly set using `Key::TYPE_ID` or `Key::TYPE_NAME`. }
return Key
    public function key($kind, $identifier = null, array $options = [])
    {
        return $this->operation->key($kind, $identifier, $options);
    }