Namespace
Drupal\rules\Form\Expression
File
-
src/Form/Expression/RuleExpressionForm.php
View source
<?php
namespace Drupal\rules\Form\Expression;
use Drupal\Core\Form\FormStateInterface;
use Drupal\rules\Engine\RuleExpressionInterface;
class RuleExpressionForm implements ExpressionFormInterface {
use ExpressionFormTrait;
protected $rule;
public function __construct(RuleExpressionInterface $rule) {
$this->rule = $rule;
}
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;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->rule
->getConditions()
->getFormHandler()
->submitForm($form, $form_state);
$this->rule
->getActions()
->getFormHandler()
->submitForm($form, $form_state);
}
}
Classes