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

__construct() public method

Create a Key.
public __construct ( string $projectId, array $options = [] )
$projectId string The project ID.
$options array [optional] { Configuration Options @type string $namespaceId Partitions data under a namespace. Useful for [Multitenant Projects](https://cloud.google.com/datastore/docs/concepts/multitenancy). Applications with no need for multitenancy should not set this value. @type array $path The initial Key path. }
    public function __construct($projectId, array $options = [])
    {
        $this->projectId = $projectId;
        $this->options = $options + ['path' => [], 'namespaceId' => null];
        if (is_array($this->options['path']) && !empty($this->options['path'])) {
            $this->path = $this->normalizePath($this->options['path']);
        }
        unset($this->options['path']);
    }