This method does not execute any service requests.
Entities are created with a Datastore Key, or by specifying a Kind. Kinds
are only allowed for insert operations. For any other case, you must
specify a named key. If a kind is given, an ID will be automatically
allocated for the entity upon insert. Additionally, if your entity
requires a complex key elementPath, you must create the key separately.
In complex applications you may want to create your own entity types.
Google Cloud PHP supports subclassing of {@see \Google\Cloud\Datastore\Entity}.
If the name of a subclass of Entity is given in the options array, an
instance of the subclass will be returned instead of Entity.
public entity ( |
||
$key | The key used to identify the record, or a string $kind. | |
$entity | array | [optional] The data to fill the entity with. |
$options | array | [optional] { Configuration Options @type string $className The name of a class extending {@see \Google\Cloud\Datastore\Entity}. If provided, an instance of that class will be returned instead of Entity. If not set, {@see \Google\Cloud\Datastore\Entity} will be used. @type array $excludeFromIndexes A list of entity keys to exclude from datastore indexes. } |
return |