You are here

private function DrupalConstant::getConfigurationOptions in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 5.0.x modules/salesforce_mapping/src/Plugin/SalesforceMappingField/DrupalConstant.php \Drupal\salesforce_mapping\Plugin\SalesforceMappingField\DrupalConstant::getConfigurationOptions()

Form options helper.

1 call to DrupalConstant::getConfigurationOptions()
DrupalConstant::buildConfigurationForm in modules/salesforce_mapping/src/Plugin/SalesforceMappingField/DrupalConstant.php
Form constructor.

File

modules/salesforce_mapping/src/Plugin/SalesforceMappingField/DrupalConstant.php, line 70

Class

DrupalConstant
Adapter for entity Constant and fields.

Namespace

Drupal\salesforce_mapping\Plugin\SalesforceMappingField

Code

private function getConfigurationOptions(SalesforceMappingInterface $mapping) {
  $instances = $this->entityFieldManager
    ->getFieldDefinitions($mapping
    ->get('drupal_entity_type'), $mapping
    ->get('drupal_bundle'));
  $options = [];
  foreach ($instances as $key => $instance) {

    // Entity reference fields are handled elsewhere.
    if ($this
      ->instanceOfEntityReference($instance)) {
      continue;
    }
    $options[$key] = $instance
      ->getLabel();
  }
  asort($options);
  return $options;
}