class LogicalAnd in Business Rules 8
Same name and namespace in other branches
- 2.x src/Plugin/BusinessRulesCondition/LogicalAnd.php \Drupal\business_rules\Plugin\BusinessRulesCondition\LogicalAnd
Class LogicalOr.
@package Drupal\business_rules\Plugin\BusinessRulesCondition
Plugin annotation
@BusinessRulesCondition(
id = "logical_and",
label = @Translation("Logical AND"),
group = @Translation("Logical"),
description = @Translation("Logical AND condition. Returns true if all inner conditions are valid. Only conditions with same target Entity and Bundles (if defined) can be included on the set."),
reactsOnIds = {},
isContextDependent = FALSE,
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\business_rules\Plugin\BusinessRulesItemPluginBase implements BusinessRulesItemPluginInterface
- class \Drupal\business_rules\Plugin\BusinessRulesConditionPlugin implements BusinessRulesConditionPluginInterface
- class \Drupal\business_rules\Plugin\BusinessRulesCondition\ConditionSet
- class \Drupal\business_rules\Plugin\BusinessRulesCondition\LogicalAnd
- class \Drupal\business_rules\Plugin\BusinessRulesCondition\ConditionSet
- class \Drupal\business_rules\Plugin\BusinessRulesConditionPlugin implements BusinessRulesConditionPluginInterface
- class \Drupal\business_rules\Plugin\BusinessRulesItemPluginBase implements BusinessRulesItemPluginInterface
Expanded class hierarchy of LogicalAnd
1 file declares its use of LogicalAnd
File
- src/
Plugin/ BusinessRulesCondition/ LogicalAnd.php, line 24
Namespace
Drupal\business_rules\Plugin\BusinessRulesConditionView source
class LogicalAnd extends ConditionSet {
/**
* {@inheritdoc}
*/
public function __construct(array $configuration = [], $plugin_id = 'logical_and', $plugin_definition = []) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
// This variable lives at ConditionSet class.
$this->entityTypeManager = $this->util->container
->get('entity_type.manager');
}
/**
* {@inheritdoc}
*/
public function process(ConditionInterface $condition, BusinessRulesEvent $event) {
$items = $condition
->getSettings('items');
$items = BusinessRulesItemObject::itemsArrayToItemsObject($items);
/** @var \Drupal\business_rules\BusinessRulesItemObject $item */
foreach ($items as $item) {
$c = Condition::load($item
->getId());
if (!$this->processor
->isConditionValid($c, $event)) {
return FALSE;
}
}
return TRUE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BusinessRulesItemPluginBase:: |
protected | property | The business rules processor. | |
BusinessRulesItemPluginBase:: |
protected | property | The business rules util. | |
BusinessRulesItemPluginBase:: |
public | function |
Provide a description of the item. Overrides BusinessRulesItemPluginInterface:: |
|
BusinessRulesItemPluginBase:: |
public | function |
Get the redirect url for the item edit-form route. Overrides BusinessRulesItemPluginInterface:: |
|
BusinessRulesItemPluginBase:: |
public | function |
Provide the group of the item. Overrides BusinessRulesItemPluginInterface:: |
|
BusinessRulesItemPluginBase:: |
public | function |
Get the redirect url for the item collection route. Overrides BusinessRulesItemPluginInterface:: |
|
BusinessRulesItemPluginBase:: |
public | function |
Return a variable set with all used variables on the item. Overrides BusinessRulesItemPluginInterface:: |
9 |
BusinessRulesItemPluginBase:: |
public | function |
Extract the variables from the plugin settings. Overrides BusinessRulesItemPluginInterface:: |
|
BusinessRulesItemPluginBase:: |
private | function | Helper function to process tokens if the setting is an array. | |
BusinessRulesItemPluginBase:: |
public | function |
Process the tokens on the settings property for the item. Overrides BusinessRulesItemPluginInterface:: |
|
BusinessRulesItemPluginBase:: |
public | function |
Process the item replacing the variables by it's values. Overrides BusinessRulesItemPluginInterface:: |
1 |
BusinessRulesItemPluginBase:: |
public | function |
Plugin form validator. Overrides BusinessRulesItemPluginInterface:: |
11 |
BusinessRulesItemPluginInterface:: |
constant | |||
ConditionSet:: |
protected | property | The entity type manager. | |
ConditionSet:: |
private | property | We don't want to use the same wait two times for an item. | |
ConditionSet:: |
public | function |
Form constructor. Overrides BusinessRulesItemPluginBase:: |
|
ConditionSet:: |
private static | function | Do not show conditionSets that already contains the main_condition. | |
ConditionSet:: |
public | function | Provide the form fields for add Business Rule's Items. | |
ConditionSet:: |
private | function | Generate the item weight. | |
ConditionSet:: |
public static | function | Return all others conditions with the same target Entity and Bundle. | |
ConditionSet:: |
public | function |
Return the form array. Overrides BusinessRulesItemPluginBase:: |
|
ConditionSet:: |
public | function |
Process the item settings before it's saved. Overrides BusinessRulesItemPluginBase:: |
|
LogicalAnd:: |
public | function |
Process the condition. Overrides BusinessRulesConditionPlugin:: |
|
LogicalAnd:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides BusinessRulesItemPluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. |