You are here

public function ContentHubSubscription::isWebhookSet in Acquia Content Hub 8

Checks whether we have a registered webhook in this site.

Return value

bool TRUE if we have a registered webhook in this site, FALSE otherwise.

File

src/ContentHubSubscription.php, line 314

Class

ContentHubSubscription
Handles operations on the Acquia Content Hub Subscription.

Namespace

Drupal\acquia_contenthub

Code

public function isWebhookSet() {
  $webhook_uuid = $this->config
    ->get('webhook_uuid');
  $webhook_url = $this->config
    ->get('webhook_url');
  if ($settings = $this->clientManager
    ->createRequest('getSettings')) {
    if ($webhook = $settings
      ->getWebhook($webhook_url)) {
      return $webhook['uuid'] == $webhook_uuid;
    }
  }
  return FALSE;
}