You are here

protected function ContentHubConnectionManager::saveWebhookConfig in Acquia Content Hub 8.2

Saves webhook modifications to configuration.

Parameters

string $uuid: Webhook uuid.

string $url: Webhook url.

2 calls to ContentHubConnectionManager::saveWebhookConfig()
ContentHubConnectionManager::registerWebhook in src/ContentHubConnectionManager.php
Registers a webhook if it has not been registered already.
ContentHubConnectionManager::updateWebhook in src/ContentHubConnectionManager.php
Updates the specified webhook on Content Hub.

File

src/ContentHubConnectionManager.php, line 525

Class

ContentHubConnectionManager
Responsible for connection management actions.

Namespace

Drupal\acquia_contenthub

Code

protected function saveWebhookConfig(string $uuid, string $url) : void {
  $this
    ->initialize();
  $wh_path = Url::fromRoute('acquia_contenthub.webhook')
    ->toString();
  $settings_url = str_replace($wh_path, '', $url);
  $webhook = [
    'uuid' => $uuid,
    'url' => $url,
    'settings_url' => $settings_url,
  ];
  $this
    ->getContentHubConfig()
    ->set('webhook', $webhook)
    ->save();
}