public function AdvbanIpManager::expiryDurationIndex in Advanced ban 8
Get default expiry duration index.
Parameters
array $expiry_durations: Expiry durations array.
string $default_expiry_duration: Default expiry duration.
Return value
int Item index.
Overrides AdvbanIpManagerInterface::expiryDurationIndex
File
- src/
AdvbanIpManager.php, line 291
Class
- AdvbanIpManager
- Ban IP manager.
Namespace
Drupal\advbanCode
public function expiryDurationIndex(array $expiry_durations, $default_expiry_duration) {
if (!$default_expiry_duration || $default_expiry_duration == AdvbanHelper::ADVBAN_NEVER) {
$expiry_durations_index = AdvbanHelper::ADVBAN_NEVER;
}
else {
$expiry_durations_index = array_search($default_expiry_duration, $expiry_durations);
if ($expiry_durations_index === FALSE) {
$expiry_durations_index = AdvbanHelper::ADVBAN_NEVER;
}
}
return $expiry_durations_index;
}