You are here

protected function SalesforceMappingFormCrudBase::getSyncTriggerOptions in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 5.0.x modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormCrudBase.php \Drupal\salesforce_mapping_ui\Form\SalesforceMappingFormCrudBase::getSyncTriggerOptions()

Return form options for available sync triggers.

Return value

array Array of sync trigger options keyed by their machine name with their label as the value.

1 call to SalesforceMappingFormCrudBase::getSyncTriggerOptions()
SalesforceMappingFormCrudBase::buildForm in modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormCrudBase.php
Form constructor.

File

modules/salesforce_mapping_ui/src/Form/SalesforceMappingFormCrudBase.php, line 486

Class

SalesforceMappingFormCrudBase
Salesforce Mapping Form base.

Namespace

Drupal\salesforce_mapping_ui\Form

Code

protected function getSyncTriggerOptions() {
  $options = [];
  if ($this->moduleHandler
    ->moduleExists('salesforce_push')) {
    $options += [
      MappingConstants::SALESFORCE_MAPPING_SYNC_DRUPAL_CREATE => $this
        ->t('Drupal entity create (push)'),
      MappingConstants::SALESFORCE_MAPPING_SYNC_DRUPAL_UPDATE => $this
        ->t('Drupal entity update (push)'),
      MappingConstants::SALESFORCE_MAPPING_SYNC_DRUPAL_DELETE => $this
        ->t('Drupal entity delete (push)'),
    ];
  }
  if ($this->moduleHandler
    ->moduleExists('salesforce_pull')) {
    $options += [
      MappingConstants::SALESFORCE_MAPPING_SYNC_SF_CREATE => $this
        ->t('Salesforce object create (pull)'),
      MappingConstants::SALESFORCE_MAPPING_SYNC_SF_UPDATE => $this
        ->t('Salesforce object update (pull)'),
      MappingConstants::SALESFORCE_MAPPING_SYNC_SF_DELETE => $this
        ->t('Salesforce object delete (pull)'),
    ];
  }
  return $options;
}