You are here

class UserLogout in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/Plugin/BusinessRulesReactsOn/UserLogout.php \Drupal\business_rules\Plugin\BusinessRulesReactsOn\UserLogout

Class UserLogout.

@package Drupal\business_rules\Plugin\BusinessRulesReactsOn

Plugin annotation


@BusinessRulesReactsOn(
  id = "user_logout",
  label = @Translation("User has logged out"),
  description = @Translation("Reacts after the user has logged out."),
  group = @Translation("User"),
  eventName = "business_rules.user_logout",
  hasTargetEntity = TRUE,
  hasTargetBundle = TRUE,
  priority = 1000,
)

Hierarchy

Expanded class hierarchy of UserLogout

File

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

Namespace

Drupal\business_rules\Plugin\BusinessRulesReactsOn
View source
class UserLogout extends BusinessRulesReactsOnPlugin {

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BusinessRulesReactsOnPlugin::$processor protected property The business rules processor.
BusinessRulesReactsOnPlugin::$util protected property The business rules util.
BusinessRulesReactsOnPlugin::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase::__construct
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable public function Determines if the plugin is configurable.
UserLogout::processForm public function Process the BusinessRule form for reactsOn plugins. Overrides BusinessRulesReactsOnPlugin::processForm