public function ConditionSet::getSettingsForm in Business Rules 2.x
Same name and namespace in other branches
- 8 src/Plugin/BusinessRulesCondition/ConditionSet.php \Drupal\business_rules\Plugin\BusinessRulesCondition\ConditionSet::getSettingsForm()
Return the form array.
@internal param array $form
Parameters
array $form: The form array.
\Drupal\Core\Form\FormStateInterface $form_state: The form state object.
\Drupal\business_rules\ItemInterface $item: The configured item.
Return value
array The render array for the settings form.
Overrides BusinessRulesItemPluginBase::getSettingsForm
File
- src/
Plugin/ BusinessRulesCondition/ ConditionSet.php, line 102
Class
- ConditionSet
- Class ConditionSet.
Namespace
Drupal\business_rules\Plugin\BusinessRulesConditionCode
public function getSettingsForm(array &$form, FormStateInterface $form_state, ItemInterface $item) {
if ($item
->isNew()) {
$form_state
->set('business_rule_condition', $item);
return [];
}
// The conditions to process.
$settings['items'] = [
'#type' => 'details',
'#description' => t('Only conditions with no actions can be added to a condition set.'),
'#title' => t('Conditions'),
'#open' => TRUE,
];
$settings['items'][] = $this
->formItems($form, $form_state, $item);
return $settings;
}