You are here

public function MappedObjectForm::validatePush in Salesforce Suite 8.3

Verify that entity type and mapping agree.

File

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

Class

MappedObjectForm
Salesforce Mapping Form base.

Namespace

Drupal\salesforce_mapping\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', t('Please specify an entity to push.'));
    return;
  }
}