You are here

public function HoneypotSettingsController::getFormSettingsValue in Honeypot 8

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

Get a value from the retrieved form settings array.

1 call to HoneypotSettingsController::getFormSettingsValue()
HoneypotSettingsController::buildForm in src/Controller/HoneypotSettingsController.php
Form constructor.

File

src/Controller/HoneypotSettingsController.php, line 100

Class

HoneypotSettingsController
Returns responses for Honeypot module routes.

Namespace

Drupal\honeypot\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;
  }
}