You are here

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

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

Class

UnpublishContent
Class UnpublishContent.

Namespace

Drupal\business_rules\Plugin\BusinessRulesAction

Code

public function getSettingsForm(array &$form, FormStateInterface $form_state, ItemInterface $item) {
  $settings['value'] = [
    '#type' => 'textfield',
    '#title' => t('Value'),
    '#required' => TRUE,
    '#default_value' => $item
      ->getSettings('value'),
    '#description' => t('The value to be compared against the field.
        <br>All entities which the field equals to this value will be unpublished.'),
  ];
  return $settings;
}