public function setInternalKey($key)
    {
        if ($this->_key !== null && $this->_key !== $key) {
            throw new ClientException('Should not update the key of an existing document');
        }

        if (!preg_match('/^[a-zA-Z0-9_:.@\-()+,=;$!*\'%]{1,254}$/', $key)) {
            throw new ClientException('Invalid format for document key');
        }

        $this->_key = (string) $key;
    }
public function setInternalKey($key)
    {
        if ($this->_key !== null && $this->_key !== $key) {
            throw new ClientException('Should not update the key of an existing document');
        }

        if (!preg_match('/^[a-zA-Z0-9_:.@\-()+,=;$!*\'%]{1,254}$/', $key)) {
            throw new ClientException('Invalid format for document key');
        }

        $this->_key = (string) $key;
    }
public function setInternalKey ( $ key ) { if ( $ this -> _key !== null && $ this -> _key !== $ key ) { throw new ClientException ( 'Should not update the key of an existing document' ) ; } if ( ! preg_match ( '/^[a-zA-Z0-9_:.@\-()+,=;$!*\'%]{1,254}$/' , $ key ) ) { throw new ClientException ( 'Invalid format for document key' ) ; } $ this -> _key = ( string ) $ key ; }
Set the internal document key

This will throw if the key of an existing document gets updated to some other key

@throws ClientException

@param string $key - internal document key

@return void
Set the internal document key