Datastore/src/Key.php
public function state()
    {
        $end = $this->pathEnd();
        return (isset($end['id']) || isset($end['name']))
            ? self::STATE_NAMED
            : self::STATE_INCOMPLETE;
    }
public function state()
    {
        $end = $this->pathEnd();
        return (isset($end['id']) || isset($end['name']))
            ? self::STATE_NAMED
            : self::STATE_INCOMPLETE;
    }
public function state ( ) { $ end = $ this -> pathEnd ( ) ; return ( isset ( $ end [ 'id' ] ) || isset ( $ end [ 'name' ] ) ) ? self :: STATE_NAMED : self :: STATE_INCOMPLETE ; }
Check if the Key is considered Named or Incomplete.

Use `Key::STATE_NAMED` and `Key::STATE_INCOMPLETE` to check value.

Example:
```
// An incomplete key does not have an ID on its last path element.
$key = $datastore->key('parent', 1234)
->pathElement('child');

if ($key->state() === Key::STATE_INCOMPLETE) {
echo 'Key is incomplete!';
}
```

```
// A named key has a kind and an identifier on each path element.
$key = $datastore->key('parent', 1234)
->pathElement('child', 4321);

if ($key->state() === Key::STATE_NAMED) {
echo 'Key is named!';
}
```

@return bool
Check if the Key is considered Named or Incomplete .