Created
May 26, 2017 12:43
-
-
Save cosmicdreams/98060510a51fb1106a335a7c55a67a02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function cleanData($value) { | |
return $value == ("." || "") ? "" : $value; | |
} | |
/** | |
* Inheritdoc. | |
*/ | |
public function createUserMap($rowData, &$userMap) { | |
$userMap['name'] = $this->cleanData($rowData[0]); | |
$userMap['field_first_name'] = $this->cleanData($rowData[1]); | |
$userMap['field_last_name'] = $this->cleanData($rowData[2]); | |
$userMap['mail'] = $this->cleanData($rowData[3]); | |
// Add Approver if approver exists. | |
$userMap['field_approver'] = $rowData[4]; | |
$userMap['field_shipping_attention'] = $rowData[10]; | |
$userMap['field_desk_phone'] = $rowData[11]; | |
$userMap['field_phone_extension'] = $rowData[12]; | |
$userMap['field_division'] = $rowData[13]; | |
$userMap['field_job_title'] = $rowData[14]; | |
$userMap['field_bline'] = $rowData[15]; | |
// Add or create company code. | |
$userMap['field_company_code'] = [ | |
$this->findOrCreateCompanyCode($rowData[16]), | |
]; | |
// Find or Create Cost Center. | |
$curCoCo = $userMap['field_company_code']; | |
// Find or Create Cost Center. | |
$userMap['field_home_cost_center'] = [ | |
$this->findOrCreateCostCenter($rowData[17], $curCoCo), | |
]; | |
$userMap['field_profit_center'] = $rowData[18]; | |
$userMap['field_cost_center'] = [ | |
$this->findOrCreateCostCenter($rowData[19], $curCoCo), | |
]; | |
// Add or create wbse. | |
if ($rowData[20] == NULL) { | |
$userMap['field_wbse'] = NULL; | |
} | |
else { | |
$userMap['field_wbse'] = [ | |
$this->findOrCreateWbse($rowData[20]), | |
]; | |
} | |
$userMap['field_cc_node'] = $rowData[21]; | |
$userMap['field_status'] = TRUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment