abstract class ConditionalFieldsHandlerBase in Conditional Fields 4.x
Same name and namespace in other branches
- 8 src/ConditionalFieldsHandlerBase.php \Drupal\conditional_fields\ConditionalFieldsHandlerBase
Defines a base handler implementation that most handlers plugins will extend.
Hierarchy
- class \Drupal\conditional_fields\ConditionalFieldsHandlerBase implements ConditionalFieldsHandlersPluginInterface
Expanded class hierarchy of ConditionalFieldsHandlerBase
15 files declare their use of ConditionalFieldsHandlerBase
- Checkbox.php in src/
Plugin/ conditional_fields/ handler/ Checkbox.php - DateDefault.php in src/
Plugin/ conditional_fields/ handler/ DateDefault.php - DateList.php in src/
Plugin/ conditional_fields/ handler/ DateList.php - DefaultStateHandler.php in src/
Plugin/ conditional_fields/ handler/ DefaultStateHandler.php - EmailDefault.php in src/
Plugin/ conditional_fields/ handler/ EmailDefault.php
File
- src/
ConditionalFieldsHandlerBase.php, line 8
Namespace
Drupal\conditional_fieldsView source
abstract class ConditionalFieldsHandlerBase implements ConditionalFieldsHandlersPluginInterface {
/**
* {@inheritdoc}
*/
public function getWidgetValue(array $value_form) {
if (empty($value_form)) {
return NULL;
}
else {
return $value_form[0]['value'];
}
}
/**
* {@inheritdoc}
*/
public function getConditionValues(array $options) {
if (isset($options['values'])) {
$value_data = $options['values'];
}
else {
$value_data = $options;
}
if (is_array($value_data)) {
$values = $value_data;
}
elseif (is_string($value_data)) {
$values = preg_split("/[\r\n]+/g", $value_data);
}
else {
$values = [];
}
return $values;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConditionalFieldsHandlerBase:: |
public | function |
Get values form the condition options. Overrides ConditionalFieldsHandlersPluginInterface:: |
|
ConditionalFieldsHandlerBase:: |
public | function |
Get values from widget settings for plugin. Overrides ConditionalFieldsHandlersPluginInterface:: |
5 |
ConditionalFieldsHandlersPluginInterface:: |
public | function | Executes states handler according to conditional fields settings. | 15 |