Reference documentation and code samples for the Cloud Datastore V1 Client class PathElement.
A (kind, ID/name) pair used to construct a key path.
If either name or ID is set, the element is complete.
If neither is set, the element is incomplete.
Generated from protobuf message google.datastore.v1.Key.PathElement
Namespace
Google \ Cloud \ Datastore \ V1 \ Key
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ kind
string
The kind of the entity. A kind matching regex __.*__ is reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 encoded. Cannot be "". Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as __bytes<X>__ where <X> is the base-64 encoding of the bytes.
↳ id
int|string
The auto-allocated ID of the entity. Never equal to zero. Values less than zero are discouraged and may not be supported in the future.
↳ name
string
The name of the entity. A name matching regex __.*__ is reserved/read-only. A name must not be more than 1500 bytes when UTF-8 encoded. Cannot be "". Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as __bytes<X>__ where <X> is the base-64 encoding of the bytes.
getKind
The kind of the entity.
A kind matching regex __.*__ is reserved/read-only.
A kind must not contain more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
Returns
Type
Description
string
setKind
The kind of the entity.
A kind matching regex __.*__ is reserved/read-only.
A kind must not contain more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getId
The auto-allocated ID of the entity.
Never equal to zero. Values less than zero are discouraged and may not
be supported in the future.
Returns
Type
Description
int|string
hasId
setId
The auto-allocated ID of the entity.
Never equal to zero. Values less than zero are discouraged and may not
be supported in the future.
Parameter
Name
Description
var
int|string
Returns
Type
Description
$this
getName
The name of the entity.
A name matching regex __.*__ is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
Returns
Type
Description
string
hasName
setName
The name of the entity.
A name matching regex __.*__ is reserved/read-only.
A name must not be more than 1500 bytes when UTF-8 encoded.
Cannot be "".
Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
encoded as __bytes<X>__ where <X> is the base-64 encoding of the
bytes.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Datastore V1 Client - Class PathElement (1.33.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.33.1 (latest)](/php/docs/reference/cloud-datastore/latest/V1.Key.PathElement)\n- [1.33.0](/php/docs/reference/cloud-datastore/1.33.0/V1.Key.PathElement)\n- [1.32.3](/php/docs/reference/cloud-datastore/1.32.3/V1.Key.PathElement)\n- [1.31.0](/php/docs/reference/cloud-datastore/1.31.0/V1.Key.PathElement)\n- [1.30.0](/php/docs/reference/cloud-datastore/1.30.0/V1.Key.PathElement)\n- [1.29.2](/php/docs/reference/cloud-datastore/1.29.2/V1.Key.PathElement)\n- [1.28.2](/php/docs/reference/cloud-datastore/1.28.2/V1.Key.PathElement)\n- [1.26.0](/php/docs/reference/cloud-datastore/1.26.0/V1.Key.PathElement)\n- [1.25.0](/php/docs/reference/cloud-datastore/1.25.0/V1.Key.PathElement)\n- [1.24.4](/php/docs/reference/cloud-datastore/1.24.4/V1.Key.PathElement)\n- [1.23.0](/php/docs/reference/cloud-datastore/1.23.0/V1.Key.PathElement)\n- [1.22.1](/php/docs/reference/cloud-datastore/1.22.1/V1.Key.PathElement)\n- [1.21.2](/php/docs/reference/cloud-datastore/1.21.2/V1.Key.PathElement)\n- [1.19.0](/php/docs/reference/cloud-datastore/1.19.0/V1.Key.PathElement)\n- [1.18.1](/php/docs/reference/cloud-datastore/1.18.1/V1.Key.PathElement)\n- [1.17.1](/php/docs/reference/cloud-datastore/1.17.1/V1.Key.PathElement) \nReference documentation and code samples for the Cloud Datastore V1 Client class PathElement.\n\nA (kind, ID/name) pair used to construct a key path.\n\nIf either name or ID is set, the element is complete.\nIf neither is set, the element is incomplete.\n\nGenerated from protobuf message `google.datastore.v1.Key.PathElement`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Datastore \\\\ V1 \\\\ Key\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getKind\n\nThe kind of the entity.\n\nA kind matching regex `__.*__` is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n### setKind\n\nThe kind of the entity.\n\nA kind matching regex `__.*__` is reserved/read-only.\nA kind must not contain more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n### getId\n\nThe auto-allocated ID of the entity.\n\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.\n\n### hasId\n\n### setId\n\nThe auto-allocated ID of the entity.\n\nNever equal to zero. Values less than zero are discouraged and may not\nbe supported in the future.\n\n### getName\n\nThe name of the entity.\n\nA name matching regex `__.*__` is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n### hasName\n\n### setName\n\nThe name of the entity.\n\nA name matching regex `__.*__` is reserved/read-only.\nA name must not be more than 1500 bytes when UTF-8 encoded.\nCannot be `\"\"`.\nMust be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are\nencoded as `__bytes\u003cX\u003e__` where `\u003cX\u003e` is the base-64 encoding of the\nbytes.\n\n### getIdType"]]