You are here

public function SimpleMailSettingsController::getFormSettingsValue in Simple Mail 8

Same name and namespace in other branches
  1. 2.0.x src/Controller/SimpleMailSettingsController.php \Drupal\simple_mail\Controller\SimpleMailSettingsController::getFormSettingsValue()

Get a value from the retrieved form settings array.

File

src/Controller/SimpleMailSettingsController.php, line 16

Class

SimpleMailSettingsController
Returns responses for Simple Mail module routes.

Namespace

Drupal\simple_mail\Controller

Code

public function getFormSettingsValue($form_settings, $form_id) {

  // If there are settings in the array and the form ID already has a setting,
  // return the saved setting for the form ID.
  if (!empty($form_settings) && isset($form_settings[$form_id])) {
    return $form_settings[$form_id];
  }
  else {
    return 0;
  }
}