/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $expression = $this->ruleConfig->getExpression(); $expression->deleteExpression($this->uuid); // Set the expression again so that the config is copied over to the // config entity. $this->ruleConfig->setExpression($expression); $this->saveToTempStore(); $form_state->setRedirectUrl($this->getCancelUrl()); }
/** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { $expression = $this->expressionManager->createInstance($this->expressionId); $form_handler = $expression->getFormHandler(); $form_handler->submitForm($form, $form_state); $rule_expression = $this->ruleConfig->getExpression(); $rule_expression->addExpressionObject($expression); // Set the expression again so that the config is copied over to the // config entity. $this->ruleConfig->setExpression($rule_expression); $this->saveToTempStore(); $form_state->setRedirect('entity.rules_reaction_rule.edit_form', ['rules_reaction_rule' => $this->ruleConfig->id()]); }
/** * Provides the page title on the form. */ public function getTitle(ReactionRuleConfig $reaction_config, $uuid) { $rule_expression = $reaction_config->getExpression(); $expression_inside = $rule_expression->getExpression($uuid); return $this->t('Edit @expression', ['@expression' => $expression_inside->getLabel()]); }