Skip to content
Snippets Groups Projects
Commit 9ab856db authored by Aaron Bauman's avatar Aaron Bauman
Browse files

- enforce salesforce_example schema dependencies to allow install/uninstall

- reset mapped object revision log message on push success
- add "push_success" and "push_fail" subscribers in example module
parent 7d283edc
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,11 @@ langcode: en
dependencies:
module:
- user
- salesforce_example
enforced:
module:
- user
- salesforce_example
label: 'Salesforce Example Contact'
type: salesforce_mapping
key: ''
......
......@@ -46,6 +46,14 @@ class SalesforceExampleSubscriber implements EventSubscriberInterface {
$params->setParam('FirstName', 'SalesforceExample');
}
public function pushSuccess(SalesforcePushParamsEvent $event) {
drupal_set_message('push success: ' . $event->getMappedObject()->sfid());
}
public function pushFail(SalesforcePushOpEvent $event) {
drupal_set_message('push fail: ' . $event->getMappedObject()->id());
}
/**
* {@inheritdoc}
*/
......@@ -53,6 +61,8 @@ class SalesforceExampleSubscriber implements EventSubscriberInterface {
$events = [
SalesforceEvents::PUSH_ALLOWED => 'pushAllowed',
SalesforceEvents::PUSH_PARAMS => 'pushParamsAlter',
SalesforceEvents::PUSH_SUCCESS => 'pushSuccess',
SalesforceEvents::PUSH_FAIL => 'pushFail',
];
return $events;
}
......
......@@ -346,6 +346,7 @@ class MappedObject extends RevisionableContentEntityBase implements MappedObject
$this
->set('last_sync_action', 'push_' . $action)
->set('last_sync_status', TRUE)
->set('revision_log_message', '')
->save();
// Previously hook_salesforce_push_success.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment