You are here

public function UserHasRoleGroupCondition::processSettings in Business Rules 2.x

Same name and namespace in other branches
  1. 8 modules/br_group/src/Plugin/BusinessRulesCondition/UserHasRoleGroupCondition.php \Drupal\br_group\Plugin\BusinessRulesCondition\UserHasRoleGroupCondition::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

modules/br_group/src/Plugin/BusinessRulesCondition/UserHasRoleGroupCondition.php, line 105

Class

UserHasRoleGroupCondition
Class UserHasRoleGroupCondition.

Namespace

Drupal\br_group\Plugin\BusinessRulesCondition

Code

public function processSettings(array $settings, ItemInterface $item) {
  if ($settings['user_key'] == 'username') {
    $settings['user_id'] = NULL;
  }
  elseif ($settings['user_key'] == 'userid') {
    $settings['user_name'] = NULL;
  }
  return parent::processSettings($settings, $item);
}