You are here

public function ActionSet::getSettingsForm in Business Rules 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/BusinessRulesAction/ActionSet.php \Drupal\business_rules\Plugin\BusinessRulesAction\ActionSet::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/BusinessRulesAction/ActionSet.php, line 117

Class

ActionSet
Class ActionSet.

Namespace

Drupal\business_rules\Plugin\BusinessRulesAction

Code

public function getSettingsForm(array &$form, FormStateInterface $form_state, ItemInterface $item) {
  if ($item
    ->isNew()) {
    $form_state
      ->set('business_rule_action', $item);
    return [];
  }

  // The actions to be executed.
  $settings['items'] = [
    '#type' => 'details',
    '#title' => t('Actions to execute'),
    '#open' => TRUE,
  ];
  $settings['items'][] = $this
    ->formItems($form, $form_state, $item);
  return $settings;
}