public function SalesforceExampleSubscriber::pushAllowed in Salesforce Suite 8.4
Same name and namespace in other branches
- 8.3 modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php \Drupal\salesforce_example\EventSubscriber\SalesforceExampleSubscriber::pushAllowed()
- 5.0.x modules/salesforce_example/src/EventSubscriber/SalesforceExampleSubscriber.php \Drupal\salesforce_example\EventSubscriber\SalesforceExampleSubscriber::pushAllowed()
SalesforcePushAllowedEvent callback.
Parameters
\Drupal\salesforce_mapping\Event\SalesforcePushAllowedEvent $event: The push allowed event.
File
- modules/
salesforce_example/ src/ EventSubscriber/ SalesforceExampleSubscriber.php, line 33
Class
- SalesforceExampleSubscriber
- Class SalesforceExampleSubscriber.
Namespace
Drupal\salesforce_example\EventSubscriberCode
public function pushAllowed(SalesforcePushAllowedEvent $event) {
/** @var \Drupal\Core\Entity\Entity $entity */
$entity = $event
->getEntity();
if ($entity && $entity
->getEntityTypeId() == 'unpushable_entity') {
$event
->disallowPush();
}
}