You are here

protected function SalesforceMappingFormCrudBase::getSyncTriggerOptions in Salesforce Suite 8.3

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/src/Form/SalesforceMappingFormCrudBase.php
Form constructor.

File

modules/salesforce_mapping/src/Form/SalesforceMappingFormCrudBase.php, line 469

Class

SalesforceMappingFormCrudBase
Salesforce Mapping Form base.

Namespace

Drupal\salesforce_mapping\Form

Code

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