You are here

public function UserLogout::processForm in Business Rules 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/BusinessRulesReactsOn/UserLogout.php \Drupal\business_rules\Plugin\BusinessRulesReactsOn\UserLogout::processForm()

Process the BusinessRule form for reactsOn plugins.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

Overrides BusinessRulesReactsOnPlugin::processForm

File

src/Plugin/BusinessRulesReactsOn/UserLogout.php, line 29

Class

UserLogout
Class UserLogout.

Namespace

Drupal\business_rules\Plugin\BusinessRulesReactsOn

Code

public function processForm(array &$form, FormStateInterface $form_state) {
  parent::processForm($form, $form_state);
  $form['entity']['context']['target_entity_type']['#required'] = FALSE;
  $form['entity']['context']['target_entity_type']['#value'] = 'user';
  $form['entity']['context']['target_entity_type']['#disabled'] = TRUE;
  $form['entity']['context']['target_entity_type']['#options'] = [
    'user' => $form['entity']['context']['target_entity_type']['#options']['user'],
  ];
  $form['entity']['context']['target_bundle']['#options'] = [
    'user' => t('User'),
  ];
  $form['entity']['context']['target_bundle']['#required'] = FALSE;
  $form['entity']['context']['target_bundle']['#value'] = 'user';
  $form['entity']['context']['target_bundle']['#disabled'] = TRUE;
}