public static function ParagraphsSets::getWidgetStateParents in Paragraphs Sets 8.2
Returns the location of processing information within $form_state.
Parameters
array $parents: The array of #parents where the widget lives in the form.
string $field_name: The field name.
Return value
array The location of processing information within $form_state.
2 calls to ParagraphsSets::getWidgetStateParents()
- ParagraphsSets::getWidgetState in src/
ParagraphsSets.php - Retrieves processing information about the widget from $form_state.
- ParagraphsSets::setWidgetState in src/
ParagraphsSets.php - Stores processing information about the widget in $form_state.
File
- src/
ParagraphsSets.php, line 220
Class
- ParagraphsSets
- Utitlity class for paragraphs_sets.
Namespace
Drupal\paragraphs_setsCode
public static function getWidgetStateParents(array $parents, $field_name) {
// Field processing data is placed at
// $form_state->get(['field_storage', '#parents', ...$parents..., '#fields',
// $field_name]), to avoid clashes between field names and $parents parts.
return array_merge([
'field_storage',
'#parents',
], $parents, [
'#fields',
$field_name,
]);
}