You are here

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

Same name and namespace in other branches
  1. 8 modules/br_group/src/Plugin/BusinessRulesAction/AssignRoleToUserAction.php \Drupal\br_group\Plugin\BusinessRulesAction\AssignRoleToUserAction::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/BusinessRulesAction/AssignRoleToUserAction.php, line 106

Class

AssignRoleToUserAction
Class AssignRoleToUserAction.

Namespace

Drupal\br_group\Plugin\BusinessRulesAction

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);
}