You are here

public static function Flood::getConfigValue in Acquia Search 3.x

Return the integer value for the specified type and option.

Parameters

string $request_type: The incoming request type.

string $value_name: The name of the type value.

Return value

int Integer value for specified type and option.

1 call to Flood::getConfigValue()
Flood::isAllowed in src/Helper/Flood.php
Determines if a request can be sent via the flood control mechanism.

File

src/Helper/Flood.php, line 59

Class

Flood
Class Flood.

Namespace

Drupal\acquia_search\Helper

Code

public static function getConfigValue(string $request_type, string $value_name) {
  $defaults = self::getFloodDefaults();
  $escaped_request_type = str_replace('/', '_', $request_type);
  $config_id = 'flood_limit.' . $escaped_request_type . '.' . $value_name;
  return \Drupal::config('acquia_search.settings')
    ->get($config_id) ?? $defaults[$request_type][$value_name];
}