public function SetFieldValue::getSettingsForm in Business Rules 2.x
Same name and namespace in other branches
- 8 src/Plugin/BusinessRulesAction/SetFieldValue.php \Drupal\business_rules\Plugin\BusinessRulesAction\SetFieldValue::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/ SetFieldValue.php, line 35
Class
- SetFieldValue
- Class SetFieldValue.
Namespace
Drupal\business_rules\Plugin\BusinessRulesActionCode
public function getSettingsForm(array &$form, FormStateInterface $form_state, ItemInterface $item) {
$settings['value'] = [
'#type' => 'textarea',
'#title' => t('Value'),
'#required' => TRUE,
'#default_value' => $item
->getSettings('value'),
'#description' => t('The value to be set on the field.
<br>For a multi-valor field (cardinality > 1) type one value per line starting by pipeline (|) as the example:
<br>|Value 1
<br>|Value 2
<br>|Value 3'),
];
return $settings;
}