You are here

private function SalesforceMappingFormCrudBase::getPullTriggerOptions in Salesforce Suite 8.3

Return an array of Date fields suitable for use a pull trigger field.

Return value

array The options array.

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

File

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

Class

SalesforceMappingFormCrudBase
Salesforce Mapping Form base.

Namespace

Drupal\salesforce_mapping\Form

Code

private function getPullTriggerOptions() {
  $options = [];
  try {
    $describe = $this
      ->getSalesforceObject();
  } catch (\Exception $e) {

    // No describe results means no datetime fields. We're done.
    return [];
  }
  foreach ($describe
    ->getFields() as $field) {
    if ($field['type'] == 'datetime') {
      $options[$field['name']] = $field['label'];
    }
  }
  return $options;
}