Google\Cloud\Datastore\Key::keyObject PHP Method

keyObject() public method

Get the key object formatted for the datastore service.
public keyObject ( ) : array
return array
    public function keyObject()
    {
        return ['partitionId' => $this->partitionId($this->projectId, $this->options['namespaceId']), 'path' => $this->path];
    }

Usage Example

Ejemplo n.º 1
0
 public function testJsonSerialize()
 {
     $key = new Key('foo');
     $key->pathElement('Robots', '1000', Key::TYPE_NAME);
     $this->assertEquals($key->jsonSerialize(), $key->keyObject());
 }