public function SalesforceExampleSubscriber::pushParamsAlter in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php \Drupal\salesforce_example\EventSubscriber\SalesforceExampleSubscriber::pushParamsAlter()
- 8.3 modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php \Drupal\salesforce_example\EventSubscriber\SalesforceExampleSubscriber::pushParamsAlter()
SalesforcePushParamsEvent callback.
Parameters
\Drupal\salesforce_mapping\Event\SalesforcePushParamsEvent $event: The event.
File
- modules/
salesforce_example/ src/ EventSubscriber/ SalesforceExampleSubscriber.php, line 47
Class
- SalesforceExampleSubscriber
- Class SalesforceExampleSubscriber.
Namespace
Drupal\salesforce_example\EventSubscriberCode
public function pushParamsAlter(SalesforcePushParamsEvent $event) {
$mapping = $event
->getMapping();
$mapped_object = $event
->getMappedObject();
$params = $event
->getParams();
/** @var \Drupal\Core\Entity\Entity $entity */
$entity = $event
->getEntity();
if ($entity
->getEntityTypeId() != 'user') {
return;
}
if ($mapping
->id() != 'salesforce_example_contact') {
return;
}
if ($mapped_object
->isNew()) {
return;
}
$params
->setParam('FirstName', 'SalesforceExample');
}