You are here

public function SalesforceExampleSubscriber::pushSuccess in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php \Drupal\salesforce_example\EventSubscriber\SalesforceExampleSubscriber::pushSuccess()
  2. 5.0.x modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php \Drupal\salesforce_example\EventSubscriber\SalesforceExampleSubscriber::pushSuccess()

SalesforcePushParamsEvent push success callback.

Parameters

\Drupal\salesforce_mapping\Event\SalesforcePushParamsEvent $event: The event.

File

modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php, line 72

Class

SalesforceExampleSubscriber
Class SalesforceExampleSubscriber.

Namespace

Drupal\salesforce_example\EventSubscriber

Code

public function pushSuccess(SalesforcePushParamsEvent $event) {
  switch ($event
    ->getMappedObject()
    ->getMapping()
    ->id()) {
    case 'mapping1':

      // Do X.
      break;
    case 'mapping2':

      // Do Y.
      break;
  }
  \Drupal::messenger()
    ->addStatus('push success example subscriber!: ' . $event
    ->getMappedObject()
    ->sfid());
}