Skip to content
Snippets Groups Projects
Commit 2a879010 authored by Eileen McNaughton's avatar Eileen McNaughton
Browse files

[Import] [ref] Move function to parent for use by siblings

parent 7c63299d
No related branches found
No related tags found
No related merge requests found
......@@ -241,26 +241,6 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview {
$importJob->isComplete();
}
/**
* Get the mapped fields as an array of labels.
*
* e.g
* ['First Name', 'Employee Of - First Name', 'Home - Street Address']
*
* @return array
* @throws \API_Exception
* @throws \CRM_Core_Exception
*/
protected function getMappedFieldLabels(): array {
$mapper = [];
$parser = new CRM_Contact_Import_Parser_Contact();
$parser->setUserJobID($this->getUserJobID());
foreach ($this->getSubmittedValue('mapper') as $columnNumber => $mappedField) {
$mapper[$columnNumber] = $parser->getMappedFieldLabel($parser->getMappingFieldFromMapperInput($mappedField, 0, $columnNumber));
}
return $mapper;
}
/**
* @return \CRM_Contact_Import_Parser_Contact
*/
......
......@@ -567,4 +567,24 @@ class CRM_Import_Forms extends CRM_Core_Form {
return NULL;
}
/**
* Get the mapped fields as an array of labels.
*
* e.g
* ['First Name', 'Employee Of - First Name', 'Home - Street Address']
*
* @return array
* @throws \API_Exception
* @throws \CRM_Core_Exception
*/
protected function getMappedFieldLabels(): array {
$mapper = [];
$parser = new CRM_Contact_Import_Parser_Contact();
$parser->setUserJobID($this->getUserJobID());
foreach ($this->getSubmittedValue('mapper') as $columnNumber => $mappedField) {
$mapper[$columnNumber] = $parser->getMappedFieldLabel($parser->getMappingFieldFromMapperInput($mappedField, 0, $columnNumber));
}
return $mapper;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment