public function UserHasRole::processSettings in Business Rules 8
Same name and namespace in other branches
- 2.x src/Plugin/BusinessRulesCondition/UserHasRole.php \Drupal\business_rules\Plugin\BusinessRulesCondition\UserHasRole::processSettings()
Process the item settings before it's saved.
Parameters
array $settings: The settings to be processed before save the Business Rule Item.
\Drupal\business_rules\ItemInterface $item: The item being processed.
Return value
array The processed settings.
Overrides BusinessRulesItemPluginBase::processSettings
File
- src/
Plugin/ BusinessRulesCondition/ UserHasRole.php, line 61
Class
- UserHasRole
- Class UserHasRole.
Namespace
Drupal\business_rules\Plugin\BusinessRulesConditionCode
public function processSettings(array $settings, ItemInterface $item) {
foreach ($settings['roles'] as $key => $role) {
if ($role === 0) {
unset($settings['roles'][$key]);
}
}
return $settings;
}