add compound in source_info #391
This commit is contained in:
parent
c3148daa91
commit
c55b58b0ad
|
@ -50,10 +50,16 @@ class CSV extends Importer {
|
||||||
} else if( $rawColumn === 'special_comment_status' ) {
|
} else if( $rawColumn === 'special_comment_status' ) {
|
||||||
$this->set_option('item_comment_status_index', $index);
|
$this->set_option('item_comment_status_index', $index);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if ( preg_match ('/.*\|compound\(.*\)/', $rawColumn ) ) {
|
||||||
|
$data = preg_split("/[()]+/", $rawColumn, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
$parent = $data[0] . ( isset($data[2]) ? $data[2] : '' );
|
||||||
|
$columns[] = [$parent => explode($this->get_option('delimiter'), $data[1])];
|
||||||
} else {
|
} else {
|
||||||
$columns[] = $rawColumn;
|
$columns[] = $rawColumn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $columns;
|
return $columns;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue