You are here

public function MappedObjectForm::validatePush in Salesforce Suite 8.4

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

Verify that entity type and mapping agree.

File

modules/salesforce_mapping_ui/src/Form/MappedObjectForm.php, line 152

Class

MappedObjectForm
Salesforce Mapping Form base.

Namespace

Drupal\salesforce_mapping_ui\Form

Code

public function validatePush(array &$form, FormStateInterface $form_state) {
  $drupal_entity_array = $form_state
    ->getValue([
    'drupal_entity',
    0,
  ]);

  // Verify entity was given - required for push.
  if (empty($drupal_entity_array['target_id'])) {
    $form_state
      ->setErrorByName('drupal_entity][0][target_id', $this
      ->t('Please specify an entity to push.'));
    return;
  }
}