You are here

public function DeleteHandler::__construct in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/salesforce_pull/src/DeleteHandler.php \Drupal\salesforce_pull\DeleteHandler::__construct()
  2. 8.3 modules/salesforce_pull/src/DeleteHandler.php \Drupal\salesforce_pull\DeleteHandler::__construct()

Constructor.

Parameters

\Drupal\salesforce\Rest\RestClientInterface $sfapi: RestClient object.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Entity Manager service.

\Drupal\Core\State\StateInterface $state: State service.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: Event dispatcher service.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

modules/salesforce_pull/src/DeleteHandler.php, line 88

Class

DeleteHandler
Handles pull cron deletion of Drupal entities based onSF mapping settings.

Namespace

Drupal\salesforce_pull

Code

public function __construct(RestClientInterface $sfapi, EntityTypeManagerInterface $entity_type_manager, StateInterface $state, EventDispatcherInterface $event_dispatcher) {
  $this->sfapi = $sfapi;
  $this->etm = $entity_type_manager;
  $this->mappingStorage = $this->etm
    ->getStorage('salesforce_mapping');
  $this->mappedObjectStorage = $this->etm
    ->getStorage('salesforce_mapped_object');
  $this->state = $state;
  $this->eventDispatcher = $event_dispatcher;
}