You are here

abstract class SalesforceMappingFormCrudBase in Salesforce Suite 8.3

Salesforce Mapping Form base.

Hierarchy

Expanded class hierarchy of SalesforceMappingFormCrudBase

File

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

Namespace

Drupal\salesforce_mapping\Form
View source
abstract class SalesforceMappingFormCrudBase extends SalesforceMappingFormBase {

  /**
   * The storage controller.
   *
   * @var \Drupal\Core\Entity\EntityStorageInterface
   */
  protected $storageController;

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    if (!$this
      ->ensureConnection()) {
      return $form;
    }
    $form = parent::buildForm($form, $form_state);
    $mapping = $this->entity;
    $form['label'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Label'),
      '#default_value' => $mapping
        ->label(),
      '#required' => TRUE,
      '#weight' => -30,
    ];
    $form['id'] = [
      '#type' => 'machine_name',
      '#required' => TRUE,
      '#default_value' => $mapping
        ->id(),
      '#maxlength' => EntityTypeInterface::ID_MAX_LENGTH,
      '#machine_name' => [
        'exists' => [
          'Drupal\\salesforce_mapping\\Entity\\SalesforceMapping',
          'load',
        ],
        'source' => [
          'label',
        ],
      ],
      '#disabled' => !$mapping
        ->isNew(),
      '#weight' => -20,
    ];
    $form['drupal_entity'] = [
      '#title' => $this
        ->t('Drupal entity'),
      '#type' => 'details',
      '#attributes' => [
        'id' => 'edit-drupal-entity',
      ],
      // Gently discourage admins from breaking existing fieldmaps:
      '#open' => $mapping
        ->isNew(),
    ];
    $entity_types = $this
      ->getEntityTypeOptions();
    $form['drupal_entity']['drupal_entity_type'] = [
      '#title' => $this
        ->t('Drupal Entity Type'),
      '#id' => 'edit-drupal-entity-type',
      '#type' => 'select',
      '#description' => $this
        ->t('Select a Drupal entity type to map to a Salesforce object.'),
      '#options' => $entity_types,
      '#default_value' => $mapping->drupal_entity_type,
      '#required' => TRUE,
      '#empty_option' => $this
        ->t('- Select -'),
      '#ajax' => [
        'callback' => [
          $this,
          'bundleCallback',
        ],
        'event' => 'change',
        'wrapper' => 'drupal_bundle',
      ],
    ];
    $form['drupal_entity']['drupal_bundle'] = [
      '#title' => $this
        ->t('Bundle'),
      '#type' => 'select',
      '#default_value' => $mapping->drupal_bundle,
      '#empty_option' => $this
        ->t('- Select -'),
      // Bundle select options will get completely replaced after user selects
      // an entity, but we include all possibilities here for js-free
      // compatibility (for simpletest)
      '#options' => $this
        ->getBundleOptions(),
      '#required' => TRUE,
      '#prefix' => '<div id="drupal_bundle">',
      '#suffix' => '</div>',
      // Don't expose the bundle listing until user has selected an entity.
      '#states' => [
        'visible' => [
          ':input[name="drupal_entity_type"]' => [
            '!value' => '',
          ],
        ],
      ],
    ];
    $input = $form_state
      ->getUserInput();
    if (!empty($input) && !empty($input['drupal_entity_type'])) {
      $entity_type = $input['drupal_entity_type'];
    }
    else {
      $entity_type = $form['drupal_entity']['drupal_entity_type']['#default_value'];
    }
    $bundle_info = $this->entityManager
      ->getBundleInfo($entity_type);
    if (!empty($bundle_info)) {
      $form['drupal_entity']['drupal_bundle']['#options'] = [];
      $form['drupal_entity']['drupal_bundle']['#title'] = $this
        ->t('@entity_type Bundle', [
        '@entity_type' => $entity_types[$entity_type],
      ]);
      foreach ($bundle_info as $key => $info) {
        $form['drupal_entity']['drupal_bundle']['#options'][$key] = $info['label'];
      }
    }
    $form['salesforce_object'] = [
      '#title' => $this
        ->t('Salesforce object'),
      '#id' => 'edit-salesforce-object',
      '#type' => 'details',
      // Gently discourage admins from breaking existing fieldmaps:
      '#open' => $mapping
        ->isNew(),
    ];
    $salesforce_object_type = '';
    if (!empty($form_state
      ->getValues()) && !empty($form_state
      ->getValue('salesforce_object_type'))) {
      $salesforce_object_type = $form_state
        ->getValue('salesforce_object_type');
    }
    elseif ($mapping->salesforce_object_type) {
      $salesforce_object_type = $mapping->salesforce_object_type;
    }
    $form['salesforce_object']['salesforce_object_type'] = [
      '#title' => $this
        ->t('Salesforce Object'),
      '#id' => 'edit-salesforce-object-type',
      '#type' => 'select',
      '#description' => $this
        ->t('Select a Salesforce object to map.'),
      '#default_value' => $salesforce_object_type,
      '#options' => $this
        ->getSalesforceObjectTypeOptions(),
      '#required' => TRUE,
      '#empty_option' => $this
        ->t('- Select -'),
    ];

    // @TODO either change sync_triggers to human readable values, or make them work as hex flags again.
    $trigger_options = $this
      ->getSyncTriggerOptions();
    $form['sync_triggers'] = [
      '#title' => t('Action triggers'),
      '#type' => 'details',
      '#open' => TRUE,
      '#tree' => TRUE,
      '#description' => t('Select which actions on Drupal entities and Salesforce
        objects should trigger a synchronization. These settings are used by the
        salesforce_push and salesforce_pull modules.'),
    ];
    if (empty($trigger_options)) {
      $form['sync_triggers']['#description'] .= ' ' . $this
        ->t('<br/><em>No trigger options are available when Salesforce Push and Pull modules are disabled. Enable one or both modules to allow Push or Pull processing.</em>');
    }
    foreach ($trigger_options as $option => $label) {
      $form['sync_triggers'][$option] = [
        '#title' => $label,
        '#type' => 'checkbox',
        '#default_value' => !empty($mapping->sync_triggers[$option]),
      ];
    }
    if ($this->moduleHandler
      ->moduleExists('salesforce_pull')) {

      // @TODO should push and pull settings get moved into push and pull modules?
      $form['pull'] = [
        '#title' => t('Pull Settings'),
        '#type' => 'details',
        '#description' => '',
        '#open' => TRUE,
        '#tree' => FALSE,
        '#states' => [
          'visible' => [
            ':input[name^="sync_triggers[pull"]' => [
              'checked' => TRUE,
            ],
          ],
        ],
      ];
      if (!$mapping
        ->isNew()) {
        $form['pull']['last_pull_date'] = [
          '#type' => 'item',
          '#title' => t('Last Pull Date: %last_pull', [
            '%last_pull' => $mapping
              ->getLastPullTime() ? \Drupal::service('date.formatter')
              ->format($mapping
              ->getLastPullTime()) : 'never',
          ]),
          '#markup' => t('Resetting last pull date will cause salesforce pull module to query for updated records without respect for the pull trigger date. This is useful, for example, to re-pull all records after a purge.'),
        ];
        $form['pull']['last_pull_reset'] = [
          '#type' => 'button',
          '#value' => t('Reset Last Pull Date'),
          '#disabled' => $mapping
            ->getLastPullTime() == NULL,
          '#limit_validation_errors' => [],
          '#validate' => [
            '::lastPullReset',
          ],
        ];
        $form['pull']['last_delete_date'] = [
          '#type' => 'item',
          '#title' => t('Last Delete Date: %last_pull', [
            '%last_pull' => $mapping
              ->getLastDeleteTime() ? \Drupal::service('date.formatter')
              ->format($mapping
              ->getLastDeleteTime()) : 'never',
          ]),
          '#markup' => t('Resetting last delete date will cause salesforce pull module to query for deleted record without respect for the pull trigger date.'),
        ];
        $form['pull']['last_delete_reset'] = [
          '#type' => 'button',
          '#value' => t('Reset Last Delete Date'),
          '#disabled' => $mapping
            ->getLastDeleteTime() == NULL,
          '#limit_validation_errors' => [],
          '#validate' => [
            '::lastDeleteReset',
          ],
        ];

        // This doesn't work until after mapping gets saved.
        // @TODO figure out best way to alert admins about this, or AJAX-ify it.
        $form['pull']['pull_trigger_date'] = [
          '#type' => 'select',
          '#title' => t('Date field to trigger pull'),
          '#description' => t('Poll Salesforce for updated records based on the given date field. Defaults to "Last Modified Date".'),
          '#required' => $mapping->salesforce_object_type,
          '#default_value' => $mapping->pull_trigger_date,
          '#options' => $this
            ->getPullTriggerOptions(),
        ];
      }
      $form['pull']['pull_where_clause'] = [
        '#title' => t('Pull query SOQL "Where" clause'),
        '#type' => 'textarea',
        '#description' => t('Add a "where" SOQL condition clause to limit records pulled from Salesforce. e.g. Email != \'\' AND RecordType.DevelopName = \'ExampleRecordType\''),
        '#default_value' => $mapping->pull_where_clause,
      ];
      $form['pull']['pull_where_clause'] = [
        '#title' => t('Pull query SOQL "Where" clause'),
        '#type' => 'textarea',
        '#description' => t('Add a "where" SOQL condition clause to limit records pulled from Salesforce. e.g. Email != \'\' AND RecordType.DevelopName = \'ExampleRecordType\''),
        '#default_value' => $mapping->pull_where_clause,
      ];
      $form['pull']['pull_frequency'] = [
        '#title' => t('Pull Frequency'),
        '#type' => 'number',
        '#default_value' => $mapping->pull_frequency,
        '#description' => t('Enter a frequency, in seconds, for how often this mapping should be used to pull data to Drupal. Enter 0 to pull as often as possible. FYI: 1 hour = 3600; 1 day = 86400. <em>NOTE: pull frequency is shared per-Salesforce Object. The setting is exposed here for convenience.</em>'),
      ];
      $description = t('Check this box to disable cron pull processing for this mapping, and allow standalone processing only. A URL will be generated after saving the mapping.');
      if ($mapping
        ->id()) {
        $standalone_url = Url::fromRoute('salesforce_pull.endpoint.salesforce_mapping', [
          'salesforce_mapping' => $mapping
            ->id(),
          'key' => \Drupal::state()
            ->get('system.cron_key'),
        ], [
          'absolute' => TRUE,
        ])
          ->toString();
        $description = t('Check this box to disable cron pull processing for this mapping, and allow standalone processing via this URL: <a href=":url">:url</a>', [
          ':url' => $standalone_url,
        ]);
      }
      $form['pull']['pull_standalone'] = [
        '#title' => t('Enable standalone pull queue processing'),
        '#type' => 'checkbox',
        '#description' => $description,
        '#default_value' => $mapping->pull_standalone,
      ];

      // If global standalone is enabled, then we force this mapping's
      // standalone property to true.
      if ($this
        ->config('salesforce.settings')
        ->get('standalone')) {
        $settings_url = Url::fromRoute('salesforce.global_settings')
          ->toString();
        $form['pull']['pull_standalone']['#default_value'] = TRUE;
        $form['pull']['pull_standalone']['#disabled'] = TRUE;
        $form['pull']['pull_standalone']['#description'] .= ' ' . t('See also <a href="@url">global standalone processing settings</a>.', [
          '@url' => $settings_url,
        ]);
      }
    }
    if ($this->moduleHandler
      ->moduleExists('salesforce_push')) {
      $form['push'] = [
        '#title' => t('Push Settings'),
        '#type' => 'details',
        '#description' => t('The asynchronous push queue is always enabled in Drupal 8: real-time push fails are queued for async push. Alternatively, you can choose to disable real-time push and use async-only.'),
        '#open' => TRUE,
        '#tree' => FALSE,
        '#states' => [
          'visible' => [
            ':input[name^="sync_triggers[push"]' => [
              'checked' => TRUE,
            ],
          ],
        ],
      ];
      $form['push']['async'] = [
        '#title' => t('Disable real-time push'),
        '#type' => 'checkbox',
        '#description' => t('When real-time push is disabled, enqueue changes and push to Salesforce asynchronously during cron. When disabled, push changes immediately upon entity CRUD, and only enqueue failures for async push.'),
        '#default_value' => $mapping->async,
      ];
      $form['push']['push_frequency'] = [
        '#title' => t('Push Frequency'),
        '#type' => 'number',
        '#default_value' => $mapping->push_frequency,
        '#description' => t('Enter a frequency, in seconds, for how often this mapping should be used to push data to Salesforce. Enter 0 to push as often as possible. FYI: 1 hour = 3600; 1 day = 86400.'),
        '#min' => 0,
      ];
      $form['push']['push_limit'] = [
        '#title' => t('Push Limit'),
        '#type' => 'number',
        '#default_value' => $mapping->push_limit,
        '#description' => t('Enter the maximum number of records to be pushed to Salesforce during a single queue batch. Enter 0 to process as many records as possible, subject to the global push queue limit.'),
        '#min' => 0,
      ];
      $form['push']['push_retries'] = [
        '#title' => t('Push Retries'),
        '#type' => 'number',
        '#default_value' => $mapping->push_retries,
        '#description' => t("Enter the maximum number of attempts to push a record to Salesforce before it's considered failed. Enter 0 for no limit."),
        '#min' => 0,
      ];
      $form['push']['weight'] = [
        '#title' => t('Weight'),
        '#type' => 'select',
        '#options' => array_combine(range(-50, 50), range(-50, 50)),
        '#description' => t('Not yet in use. During cron, mapping weight determines in which order items will be pushed. Lesser weight items will be pushed before greater weight items.'),
        '#default_value' => $mapping->weight,
      ];
      $description = t('Check this box to disable cron push processing for this mapping, and allow standalone processing. A URL will be generated after saving the mapping.');
      if ($mapping
        ->id()) {
        $standalone_url = Url::fromRoute('salesforce_push.endpoint.salesforce_mapping', [
          'salesforce_mapping' => $mapping
            ->id(),
          'key' => \Drupal::state()
            ->get('system.cron_key'),
        ], [
          'absolute' => TRUE,
        ])
          ->toString();
        $description = t('Check this box to disable cron push processing for this mapping, and allow standalone processing via this URL: <a href=":url">:url</a>', [
          ':url' => $standalone_url,
        ]);
      }
      $form['push']['push_standalone'] = [
        '#title' => t('Enable standalone push queue processing'),
        '#type' => 'checkbox',
        '#description' => $description,
        '#default_value' => $mapping->push_standalone,
      ];

      // If global standalone is enabled, then we force this mapping's
      // standalone property to true.
      if ($this
        ->config('salesforce.settings')
        ->get('standalone')) {
        $settings_url = Url::fromRoute('salesforce.global_settings')
          ->toString();
        $form['push']['push_standalone']['#default_value'] = TRUE;
        $form['push']['push_standalone']['#disabled'] = TRUE;
        $form['push']['push_standalone']['#description'] .= ' ' . t('See also <a href="@url">global standalone processing settings</a>.', [
          '@url' => $settings_url,
        ]);
      }
    }
    $form['meta'] = [
      '#type' => 'details',
      '#open' => TRUE,
      '#tree' => FALSE,
      '#title' => t('Additional properties'),
    ];
    $form['meta']['weight'] = [
      '#title' => t('Weight'),
      '#type' => 'select',
      '#options' => array_combine(range(-50, 50), range(-50, 50)),
      '#description' => t('During cron, mapping weight determines in which order items will be pushed or pulled. Lesser weight items will be pushed or pulled before greater weight items.'),
      '#default_value' => $mapping->weight,
    ];
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function validateForm(array &$form, FormStateInterface $form_state) {
    $bundles = $this->entityManager
      ->getBundleInfo($form_state
      ->getValue('drupal_entity_type'));
    if (empty($bundles[$form_state
      ->getValue('drupal_bundle')])) {
      $form_state
        ->setErrorByName('drupal_bundle', $this
        ->t('Invalid bundle for entity type.'));
    }
    $button = $form_state
      ->getTriggeringElement();
    if ($button['#id'] != $form['actions']['submit']['#id']) {

      // Skip validation unless we hit the "save" button.
      return;
    }
    parent::validateForm($form, $form_state);
    if ($this->entity
      ->doesPull()) {
      try {
        $this->client
          ->query($this->entity
          ->getPullQuery());
      } catch (\Exception $e) {
        $form_state
          ->setError($form['pull']['pull_where_clause'], $this
          ->t('Test pull query returned an error. Please check logs for error details.'));
        \Drupal::service('event_dispatcher')
          ->dispatch(SalesforceEvents::ERROR, new SalesforceErrorEvent($e));
      }
    }
  }

  /**
   * Submit handler for "reset pull timestamp" button.
   */
  public function lastPullReset(array $form, FormStateInterface $form_state) {
    $mapping = $this->entity
      ->setLastPullTime(NULL);
    $this->entityTypeManager
      ->getStorage('salesforce_mapped_object')
      ->setForcePull($mapping);
  }

  /**
   * Submit handler for "reset delete timestamp" button.
   */
  public function lastDeleteReset(array $form, FormStateInterface $form_state) {
    $this->entity
      ->setLastDeleteTime(NULL);
  }

  /**
   * Ajax callback for salesforce_mapping_form() bundle selection.
   */
  public function bundleCallback($form, FormStateInterface $form_state) {
    return $form['drupal_entity']['drupal_bundle'];
  }

  /**
   * Return an array of all bundle options, for javascript-free fallback.
   */
  protected function getBundleOptions() {
    $entities = $this
      ->getEntityTypeOptions();
    $bundles = $this->entityManager
      ->getAllBundleInfo();
    $options = [];
    foreach ($bundles as $entity => $bundle_info) {
      if (empty($entities[$entity])) {
        continue;
      }
      foreach ($bundle_info as $bundle => $info) {
        $entity_label = $entities[$entity];
        $options[(string) $entity_label][$bundle] = (string) $info['label'];
      }
    }
    return $options;
  }

  /**
   * Return a list of Drupal entity types for mapping.
   *
   * @return array
   *   An array of values keyed by machine name of the entity with the label as
   *   the value, formatted to be appropriate as a value for #options.
   */
  protected function getEntityTypeOptions() {
    $options = [];
    $mappable_entity_types = $this->mappableEntityTypes
      ->getMappableEntityTypes();
    foreach ($mappable_entity_types as $entity_type_id => $info) {
      $options[$info
        ->id()] = $info
        ->getLabel();
    }
    uasort($options, function ($a, $b) {
      return strcmp($a
        ->render(), $b
        ->render());
    });
    return $options;
  }

  /**
   * Return form options for available sync triggers.
   *
   * @return array
   *   Array of sync trigger options keyed by their machine name with their
   *   label as the value.
   */
  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;
  }

  /**
   * Return an array of Date fields suitable for use a pull trigger field.
   *
   * @return array
   *   The options array.
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
EntityForm::$entityTypeManager protected property The entity type manager. 3
EntityForm::$moduleHandler protected property The module handler service.
EntityForm::$operation protected property The name of the current operation.
EntityForm::$privateEntityManager private property The entity manager.
EntityForm::actions protected function Returns an array of supported actions for the current entity form. 29
EntityForm::actionsElement protected function Returns the action form element for the current entity form.
EntityForm::afterBuild public function Form element #after_build callback: Updates the entity with submitted data.
EntityForm::buildEntity public function Builds an updated entity object based upon the submitted form values. Overrides EntityFormInterface::buildEntity 2
EntityForm::copyFormValuesToEntity protected function Copies top-level form values to entity properties 7
EntityForm::form public function Gets the actual form array to be built. 30
EntityForm::getBaseFormId public function Returns a string identifying the base form. Overrides BaseFormIdInterface::getBaseFormId 5
EntityForm::getEntity public function Gets the form entity. Overrides EntityFormInterface::getEntity
EntityForm::getEntityFromRouteMatch public function Determines which entity will be used by this form from a RouteMatch object. Overrides EntityFormInterface::getEntityFromRouteMatch 1
EntityForm::getFormId public function Returns a unique string identifying the form. Overrides FormInterface::getFormId 10
EntityForm::getOperation public function Gets the operation identifying the form. Overrides EntityFormInterface::getOperation
EntityForm::init protected function Initialize the form state and the entity before the first form build. 3
EntityForm::prepareEntity protected function Prepares the entity object before the form is built first. 3
EntityForm::prepareInvokeAll protected function Invokes the specified prepare hook variant.
EntityForm::processForm public function Process callback: assigns weights and hides extra fields.
EntityForm::setEntity public function Sets the form entity. Overrides EntityFormInterface::setEntity
EntityForm::setEntityManager public function Sets the entity manager for this form. Overrides EntityFormInterface::setEntityManager
EntityForm::setEntityTypeManager public function Sets the entity type manager for this form. Overrides EntityFormInterface::setEntityTypeManager
EntityForm::setModuleHandler public function Sets the module handler for this form. Overrides EntityFormInterface::setModuleHandler
EntityForm::setOperation public function Sets the operation for this form. Overrides EntityFormInterface::setOperation
EntityForm::submitForm public function This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state… Overrides FormInterface::submitForm 17
EntityForm::__get public function
EntityForm::__set public function
FormBase::$configFactory protected property The config factory. 1
FormBase::$requestStack protected property The request stack. 1
FormBase::$routeMatch protected property The route match.
FormBase::config protected function Retrieves a configuration object.
FormBase::configFactory protected function Gets the config factory for this form. 1
FormBase::container private function Returns the service container.
FormBase::currentUser protected function Gets the current user.
FormBase::getRequest protected function Gets the request object.
FormBase::getRouteMatch protected function Gets the route match.
FormBase::logger protected function Gets the logger for a specific channel.
FormBase::redirect protected function Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait::redirect
FormBase::resetConfigFactory public function Resets the configuration factory.
FormBase::setConfigFactory public function Sets the config factory for this form.
FormBase::setRequestStack public function Sets the request stack object to use.
LinkGeneratorTrait::$linkGenerator protected property The link generator. 1
LinkGeneratorTrait::getLinkGenerator Deprecated protected function Returns the link generator.
LinkGeneratorTrait::l Deprecated protected function Renders a link to a route given a route name and its parameters.
LinkGeneratorTrait::setLinkGenerator Deprecated public function Sets the link generator service.
LoggerChannelTrait::$loggerFactory protected property The logger channel factory service.
LoggerChannelTrait::getLogger protected function Gets the logger for a specific channel.
LoggerChannelTrait::setLoggerFactory public function Injects the logger channel factory.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 1
RedirectDestinationTrait::getDestinationArray protected function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
RedirectDestinationTrait::getRedirectDestination protected function Returns the redirect destination service.
RedirectDestinationTrait::setRedirectDestination public function Sets the redirect destination service.
SalesforceMappingFormBase::$client protected property Salesforce client.
SalesforceMappingFormBase::$entity protected property The mapping entity for this form. Overrides EntityForm::$entity
SalesforceMappingFormBase::$mappableEntityTypes protected property Mappable types service.
SalesforceMappingFormBase::$mappingFieldPluginManager protected property Field plugin manager.
SalesforceMappingFormBase::create public static function Instantiates a new instance of this class. Overrides FormBase::create
SalesforceMappingFormBase::ensureConnection protected function Test the Salesforce connection by issuing the given api call.
SalesforceMappingFormBase::getSalesforceObject protected function Retreive Salesforce's information about an object type.
SalesforceMappingFormBase::getSalesforceObjectTypeOptions protected function Helper to retreive a list of object type options.
SalesforceMappingFormBase::save public function Form submission handler for the 'save' action. Overrides EntityForm::save 1
SalesforceMappingFormBase::__construct public function SalesforceMappingFormBase constructor.
SalesforceMappingFormCrudBase::$storageController protected property The storage controller.
SalesforceMappingFormCrudBase::buildForm public function Form constructor. Overrides EntityForm::buildForm
SalesforceMappingFormCrudBase::bundleCallback public function Ajax callback for salesforce_mapping_form() bundle selection.
SalesforceMappingFormCrudBase::getBundleOptions protected function Return an array of all bundle options, for javascript-free fallback.
SalesforceMappingFormCrudBase::getEntityTypeOptions protected function Return a list of Drupal entity types for mapping.
SalesforceMappingFormCrudBase::getPullTriggerOptions private function Return an array of Date fields suitable for use a pull trigger field.
SalesforceMappingFormCrudBase::getSyncTriggerOptions protected function Return form options for available sync triggers.
SalesforceMappingFormCrudBase::lastDeleteReset public function Submit handler for "reset delete timestamp" button.
SalesforceMappingFormCrudBase::lastPullReset public function Submit handler for "reset pull timestamp" button.
SalesforceMappingFormCrudBase::validateForm public function Form validation handler. Overrides FormBase::validateForm
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
UrlGeneratorTrait::$urlGenerator protected property The url generator.
UrlGeneratorTrait::getUrlGenerator Deprecated protected function Returns the URL generator service.
UrlGeneratorTrait::setUrlGenerator Deprecated public function Sets the URL generator service.
UrlGeneratorTrait::url Deprecated protected function Generates a URL or path for a specific route based on the given parameters.