You are here

public function AutoConnector::connectToAcquia in Acquia Connector 3.x

Same name and namespace in other branches
  1. 8.2 src/AutoConnector.php \Drupal\acquia_connector\AutoConnector::connectToAcquia()
  2. 8 src/AutoConnector.php \Drupal\acquia_connector\AutoConnector::connectToAcquia()

Ensures a connection to Acquia Subscription.

Return value

mixed False or whatever is returned by Subscription::update.

File

src/AutoConnector.php, line 57

Class

AutoConnector
Subscription Auto connector storage.

Namespace

Drupal\acquia_connector

Code

public function connectToAcquia() {
  if ($this->subscription
    ->hasCredentials()) {
    return FALSE;
  }
  if (empty($this->globalConfig['ah_network_key'])) {
    return FALSE;
  }
  if (empty($this->globalConfig['ah_network_identifier'])) {
    return FALSE;
  }
  $this->storage
    ->setKey($this->globalConfig['ah_network_key']);
  $this->storage
    ->setIdentifier($this->globalConfig['ah_network_identifier']);
  return $this->subscription
    ->update();
}