You are here

protected function DeleteHandler::handleDeletedRecords in Salesforce Suite 8.3

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

Delete records.

Parameters

array $deleted: Array of deleted records.

string $type: Salesforce object type.

1 call to DeleteHandler::handleDeletedRecords()
DeleteHandler::processDeletedRecords in modules/salesforce_pull/src/DeleteHandler.php
Process deleted records from salesforce.

File

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

Class

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

Namespace

Drupal\salesforce_pull

Code

protected function handleDeletedRecords(array $deleted, $type) {
  if (empty($deleted['deletedRecords'])) {
    return;
  }
  $sf_mappings = $this->mappingStorage
    ->loadByProperties([
    'salesforce_object_type' => $type,
  ]);
  if (empty($sf_mappings)) {
    return;
  }
  foreach ($deleted['deletedRecords'] as $record) {
    $this
      ->handleDeletedRecord($record, $type);
  }
}