You are here

protected function Rest::createMappedObject in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 modules/salesforce_push/src/Plugin/SalesforcePushQueueProcessor/Rest.php \Drupal\salesforce_push\Plugin\SalesforcePushQueueProcessor\Rest::createMappedObject()
  2. 5.0.x modules/salesforce_push/src/Plugin/SalesforcePushQueueProcessor/Rest.php \Drupal\salesforce_push\Plugin\SalesforcePushQueueProcessor\Rest::createMappedObject()

Helper method to generate a new MappedObject during push procesing.

Parameters

object $item: Push queue item.

\Drupal\salesforce_mapping\Entity\SalesforceMappingInterface $mapping: The mapping.

Return value

\Drupal\salesforce_mapping\Entity\MappedObjectInterface The new mapped object.

1 call to Rest::createMappedObject()
Rest::getMappedObject in modules/salesforce_push/src/Plugin/SalesforcePushQueueProcessor/Rest.php
Return the mapped object given a queue item and mapping.

File

modules/salesforce_push/src/Plugin/SalesforcePushQueueProcessor/Rest.php, line 255

Class

Rest
Rest queue processor plugin.

Namespace

Drupal\salesforce_push\Plugin\SalesforcePushQueueProcessor

Code

protected function createMappedObject(\stdClass $item, SalesforceMappingInterface $mapping) {
  return new MappedObject([
    'drupal_entity' => [
      'target_id' => $item->entity_id,
      'target_type' => $mapping->drupal_entity_type,
    ],
    'salesforce_mapping' => $mapping
      ->id(),
  ]);
}