public function MappingEditFormBase::extractMappingData in GatherContent 8.4
Same name and namespace in other branches
- 8.5 gathercontent_ui/src/Form/MappingEditFormBase.php \Drupal\gathercontent_ui\Form\MappingEditFormBase::extractMappingData()
Extract mapping data from submitted form values.
Parameters
array $formValues: Array with all submitted values.
Return value
array Mapping data.
1 call to MappingEditFormBase::extractMappingData()
- MappingEditForm::submitForm in gathercontent_ui/
src/ Form/ MappingEditForm.php - This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…
File
- gathercontent_ui/
src/ Form/ MappingEditFormBase.php, line 499
Class
- MappingEditFormBase
- Class MappingEditFormBase.
Namespace
Drupal\gathercontent_ui\FormCode
public function extractMappingData(array $formValues) {
$form_definition_elements = [
'return',
'form_build_id',
'form_token',
'form_id',
'op',
];
$non_data_elements = array_merge($form_definition_elements, [
'gc_template',
'content_type',
'id',
'updated',
'gathercontent_project',
'gathercontent_template',
'er_mapping_type',
'submit',
'close',
]);
$mapping_data = [];
foreach ($formValues as $key => $value) {
if (!in_array($key, $non_data_elements)) {
$mapping_data[$key] = $value;
}
}
$this->mappingData = $mapping_data;
return $mapping_data;
}