class RuleExpressionForm in Rules 8.3
Form view structure for rule expressions.
Hierarchy
- class \Drupal\rules\Form\Expression\RuleExpressionForm implements ExpressionFormInterface uses ExpressionFormTrait
Expanded class hierarchy of RuleExpressionForm
See also
\Drupal\rules\Plugin\RulesExpression\RuleExpression
File
- src/
Form/ Expression/ RuleExpressionForm.php, line 13
Namespace
Drupal\rules\Form\ExpressionView source
class RuleExpressionForm implements ExpressionFormInterface {
use ExpressionFormTrait;
/**
* The rule expression object this form is for.
*
* @var \Drupal\rules\Engine\RuleExpressionInterface
*/
protected $rule;
/**
* Creates a new object of this class.
*/
public function __construct(RuleExpressionInterface $rule) {
$this->rule = $rule;
}
/**
* {@inheritdoc}
*/
public function form(array $form, FormStateInterface $form_state) {
$conditions_form_handler = $this->rule
->getConditions()
->getFormHandler();
$form = $conditions_form_handler
->form($form, $form_state);
$actions_form_handler = $this->rule
->getActions()
->getFormHandler();
$form = $actions_form_handler
->form($form, $form_state);
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->rule
->getConditions()
->getFormHandler()
->submitForm($form, $form_state);
$this->rule
->getActions()
->getFormHandler()
->submitForm($form, $form_state);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExpressionFormTrait:: |
public | function | Implements ExpressionFormInterface::validateForm(). | |
RuleExpressionForm:: |
protected | property | The rule expression object this form is for. | |
RuleExpressionForm:: |
public | function |
Adds elements specific to the expression to the form. Overrides ExpressionFormInterface:: |
|
RuleExpressionForm:: |
public | function |
Implements ExpressionFormInterface::submitForm(). Overrides ExpressionFormTrait:: |
|
RuleExpressionForm:: |
public | function | Creates a new object of this class. |