You are here

function drush_acquia_contenthub_disconnect_site in Acquia Content Hub 8

Disconnects a site from Content Hub.

File

./acquia_contenthub.drush.inc, line 775
ContentHub Drush Commands.

Code

function drush_acquia_contenthub_disconnect_site() {

  /** @var \Drupal\acquia_contenthub\ContentHubSubscription $subscription */
  $subscription = \Drupal::service('acquia_contenthub.acquia_contenthub_subscription');
  $subscription
    ->disconnectClient();

  // disconnectClient always returns false. Check config to be sure of success.
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('acquia_contenthub.admin_settings');
  $webhook_uuid = $config
    ->get('webhook_uuid');
  if (!$webhook_uuid) {
    drush_log(dt('Site has been disconnected from Content Hub.'), LogLevel::SUCCESS);
  }
}