You are here

public function SalesforceEncryptServiceProvider::alter in Salesforce Suite 8.3

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

modules/salesforce_encrypt/src/SalesforceEncryptServiceProvider.php, line 18

Class

SalesforceEncryptServiceProvider
Modifies the salesforce client service.

Namespace

Drupal\salesforce_encrypt

Code

public function alter(ContainerBuilder $container) {

  // Overrides salesforce.client class with our EncryptedRestClientInterface.
  $container
    ->getDefinition('salesforce.client')
    ->setClass(RestClient::class)
    ->addArgument(new Reference('encryption'))
    ->addArgument(new Reference('encrypt.encryption_profile.manager'))
    ->addArgument(new Reference('lock'));
}