# lock()

## Signature

```php
public function lock(ProductHosting $productHosting): ServerHostingLockedResponse
```

## Description

Suspension of the product. This happens when the payment is overdue or the admin initiated the locking process.

## Return value

ServerHostingLockedResponse for success, Exception with the mesage on error. Example:

```php
return new ServerHostingLockedResponse()
```

## Example

<pre class="language-php"><code class="lang-php"><strong>/**
</strong> * @param ProductHosting $productHosting
 * @return ServerHostingLockedResponse
 * @throws GuzzleException
 */
public function lock(ProductHosting $productHosting): ServerHostingLockedResponse {
        // API request to disable the user
        $res = $this->getClient($productHosting->host)->disableUser($productHosting->custom_fields['nextcloudUser']);
        
        // error handling
        if (isset($res['meta']) &#x26;&#x26; $res['meta']['statuscode'] !== "100") {
		throw new Exception(json_encode($res));
        }

        // success
	return new ServerHostingLockedResponse();
}
</code></pre>
