interface BusinessRulesItemPluginInterface in Business Rules 8
Same name and namespace in other branches
- 2.x src/Plugin/BusinessRulesItemPluginInterface.php \Drupal\business_rules\Plugin\BusinessRulesItemPluginInterface
Interface BusinessRulesItemInterface.
@package Drupal\business_rules\Plugin
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface
- interface \Drupal\business_rules\Plugin\BusinessRulesItemPluginInterface
Expanded class hierarchy of BusinessRulesItemPluginInterface
All classes that implement BusinessRulesItemPluginInterface
1 file declares its use of BusinessRulesItemPluginInterface
- CustomValueVariable.php in src/
Plugin/ BusinessRulesVariable/ CustomValueVariable.php
File
- src/
Plugin/ BusinessRulesItemPluginInterface.php, line 16
Namespace
Drupal\business_rules\PluginView source
interface BusinessRulesItemPluginInterface extends PluginInspectionInterface {
const VARIABLE_REGEX = '{{((\\w+|\\w+\\[\\d+\\]|\\w+\\[\\d+\\]\\-\\>+\\w+)|(\\w+\\-\\>+\\w+|\\w\\[\\d+\\]|\\w\\[\\d+\\]\\-\\>+\\w+)+?)}}';
/**
* Form constructor.
*
* Give a chance to plugin to change the buildForm method.
*
* @param array $form
* The form array.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state object.
*/
public function buildForm(array &$form, FormStateInterface $form_state);
/**
* Provide a description of the item.
*
* @return string
* A string description of the item.
*/
public function getDescription();
/**
* Get the redirect url for the item edit-form route.
*
* @param \Drupal\business_rules\ItemInterface $item
* The business rule item.
*
* @return \Drupal\Core\Url
* The Url.
*/
public function getEditUrl(ItemInterface $item);
/**
* Provide the group of the item.
*
* @return string
* The item group name
*/
public function getGroup();
/**
* Get the redirect url for the item collection route.
*
* @param \Drupal\business_rules\ItemInterface $item
* The item go get the Url.
*
* @return \Drupal\Core\Url
* The Url.
*/
public function getRedirectUrl(ItemInterface $item);
/**
* Return the form array.
*
* @param array $form
* The form array.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state object.
* @param \Drupal\business_rules\ItemInterface $item
* The configured item.
*
* @return array
* The render array for the settings form.
*
* @internal param array $form
*/
public function getSettingsForm(array &$form, FormStateInterface $form_state, ItemInterface $item);
/**
* Return a variable set with all used variables on the item.
*
* If you are using variables in a textfield, you can use the regex as the
* following:
*
* preg_match_all(BusinessRulesItemPluginInterface::VARIABLE_REGEX, $text,
* $variables);
*
* The $variables array will be filled with all used variables at index [1]
*
* @param \Drupal\business_rules\ItemInterface $item
* The business rule item.
*
* @return \Drupal\business_rules\VariablesSet
* The variableSet with all variables used on the Item.
*/
public function getVariables(ItemInterface $item);
/**
* Extract the variables from the plugin settings.
*
* @param string $string
* The string that can have the variable token: {{variable_id}}.
*
* @return array
* Array with the variables names.
*
* @throws \Exception
*/
public function pregMatch($string);
/**
* Process the item settings before it's saved.
*
* @param array $settings
* The settings to be processed before save the Business Rule Item.
* @param \Drupal\business_rules\ItemInterface $item
* The item being processed.
*
* @return array
* The processed settings.
*/
public function processSettings(array $settings, ItemInterface $item);
/**
* Process the tokens on the settings property for the item.
*
* @param \Drupal\business_rules\ItemInterface $item
* The Business Rules item.
* @param \Drupal\business_rules\Events\BusinessRulesEvent $event
* The BusinessRulesEvent that triggered the processor.
*/
public function processTokens(ItemInterface &$item, BusinessRulesEvent $event);
/**
* Process the item replacing the variables by it's values.
*
* @param mixed $content
* The item to be replaced by the variable value.
* @param \Drupal\business_rules\VariablesSet $event_variables
* Array of Variables provided by the event.
*
* @return mixed
* The processed content, replacing the variables tokens for it's values.
*/
public function processVariables($content, VariablesSet $event_variables);
/**
* Plugin form validator.
*
* If the plugin needs to perform a form validation, override this function.
*
* @param array $form
* The form array.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state object.
*/
public function validateForm(array &$form, FormStateInterface $form_state);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BusinessRulesItemPluginInterface:: |
public | function | Form constructor. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Provide a description of the item. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Get the redirect url for the item edit-form route. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Provide the group of the item. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Get the redirect url for the item collection route. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Return the form array. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Return a variable set with all used variables on the item. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Extract the variables from the plugin settings. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Process the item settings before it's saved. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Process the tokens on the settings property for the item. | 1 |
BusinessRulesItemPluginInterface:: |
public | function | Process the item replacing the variables by it's values. | 2 |
BusinessRulesItemPluginInterface:: |
public | function | Plugin form validator. | 1 |
BusinessRulesItemPluginInterface:: |
constant | |||
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |