You are here

public function RestClient::hookEncryptionProfileDelete in Salesforce Suite 8.3

If the given profile is our active one, disable encryption.

Since we rely on a specific encryption profile, we need to respond in case it gets deleted. Check to see if the profile being deleted is the one assigned for encryption; if so, decrypt our config and disable encryption.

Parameters

\Drupal\encrypt\EncryptionProfileInterface $profile: The encryption profile being deleted.

Overrides EncryptedRestClientInterface::hookEncryptionProfileDelete

File

modules/salesforce_encrypt/src/Rest/RestClient.php, line 113

Class

RestClient
Objects, properties, and methods to communicate with the Salesforce REST API.

Namespace

Drupal\salesforce_encrypt\Rest

Code

public function hookEncryptionProfileDelete(EncryptionProfileInterface $profile) {
  if ($this->encryptionProfileId == $profile
    ->id()) {
    $this
      ->disableEncryption();
  }
}