You are here

protected function PullBase::sendEntityId in Salesforce Suite 5.0.x

Same name and namespace in other branches
  1. 8.4 modules/salesforce_pull/src/Plugin/QueueWorker/PullBase.php \Drupal\salesforce_pull\Plugin\QueueWorker\PullBase::sendEntityId()
  2. 8.3 modules/salesforce_pull/src/Plugin/QueueWorker/PullBase.php \Drupal\salesforce_pull\Plugin\QueueWorker\PullBase::sendEntityId()

Push the Entity ID up to Salesforce.

Parameters

string $object_type: Salesforce object type.

string $sfid: Salesforce ID.

array $key_param: Key parameter to be pushed.

Return value

bool TRUE/FALSE

2 calls to PullBase::sendEntityId()
PullBase::createEntity in modules/salesforce_pull/src/Plugin/QueueWorker/PullBase.php
Create a Drupal entity and mapped object.
PullBase::updateEntity in modules/salesforce_pull/src/Plugin/QueueWorker/PullBase.php
Update an existing Drupal entity.

File

modules/salesforce_pull/src/Plugin/QueueWorker/PullBase.php, line 338

Class

PullBase
Provides base functionality for the Salesforce Pull Queue Workers.

Namespace

Drupal\salesforce_pull\Plugin\QueueWorker

Code

protected function sendEntityId(string $object_type, string $sfid, array $key_param) {
  try {
    $this->client
      ->objectUpdate($object_type, $sfid, $key_param);
    return TRUE;
  } catch (RestException $e) {
    $this->eventDispatcher
      ->dispatch(new SalesforceErrorEvent($e), SalesforceEvents::ERROR);
    return FALSE;
  }
}