You are here

public function SalesforceMappingFormBase::save in Salesforce Suite 8.3

Form submission handler for the 'save' action.

Normally this method should be overridden to provide specific messages to the user and redirect the form after the entity has been saved.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Overrides EntityForm::save

1 call to SalesforceMappingFormBase::save()
SalesforceMappingAddForm::save in modules/salesforce_mapping/src/Form/SalesforceMappingAddForm.php
Form submission handler for the 'save' action.
1 method overrides SalesforceMappingFormBase::save()
SalesforceMappingAddForm::save in modules/salesforce_mapping/src/Form/SalesforceMappingAddForm.php
Form submission handler for the 'save' action.

File

modules/salesforce_mapping/src/Form/SalesforceMappingFormBase.php, line 99

Class

SalesforceMappingFormBase
Salesforce Mapping Form base.

Namespace

Drupal\salesforce_mapping\Form

Code

public function save(array $form, FormStateInterface $form_state) {
  if (!$this->entity
    ->save()) {
    drupal_set_message($this
      ->t('An error occurred while trying to save the mapping.'));
    return;
  }
  drupal_set_message($this
    ->t('The mapping has been successfully saved.'));
}