You are here

salesforce_encrypt.install in Salesforce Suite 8.3

Requirements and uninstall hooks.

File

modules/salesforce_encrypt/salesforce_encrypt.install
View source
<?php

/**
 * @file
 * Requirements and uninstall hooks.
 */
use Drupal\Core\Url;
use Drupal\salesforce\EntityNotFoundException;

/**
 * Throw a runtime error if Salesforce encryption profile is not selected.
 *
 * Implements hook_requirements().
 */
function salesforce_encrypt_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    $requirements['salesforce_encrypt'] = [
      'severity' => REQUIREMENT_ERROR,
      'description' => t('This module is deprecated and will be removed in Salesforce 8.x-4.0. <a href="@url">See change record for additional information.</a>', [
        '@url' => 'https://www.drupal.org/node/3034230',
      ]),
    ];
  }
  return $requirements;
}

/**
 * Implements hook_uninstall().
 *
 * Decrypt and purge our data.
 */
function salesforce_encrypt_uninstall() {
  \Drupal::service('salesforce.client')
    ->disableEncryption();
  \Drupal::state()
    ->delete('salesforce_encrypt.profile');
}

Functions

Namesort descending Description
salesforce_encrypt_requirements Throw a runtime error if Salesforce encryption profile is not selected.
salesforce_encrypt_uninstall Implements hook_uninstall().