CRMTraits_Import_ParserTrait
Trait ParserTrait
Trait for testing imports.
Table of Contents
Properties
- $userJobID : int
Methods
- getDataSource() : CRM_Import_DataSource
- getMapperFromFieldMappings() : array<string|int, mixed>
- importCSV() : void
- Import the csv file values.
- submitDataSourceForm() : void
- Submit the data source form.
- submitPreviewForm() : void
- Submit the preview form, triggering the import.
Properties
$userJobID
protected
int
$userJobID
Methods
getDataSource()
protected
getDataSource() : CRM_Import_DataSource
Return values
CRM_Import_DataSourcegetMapperFromFieldMappings()
protected
getMapperFromFieldMappings(array<string|int, mixed> $mappings) : array<string|int, mixed>
Parameters
- $mappings : array<string|int, mixed>
Return values
array<string|int, mixed>importCSV()
Import the csv file values.
protected
importCSV(string $csv, array<string|int, mixed> $fieldMappings[, array<string|int, mixed> $submittedValues = [] ]) : void
This function uses a flow that mimics the UI flow.
Parameters
- $csv : string
-
Name of csv file.
- $fieldMappings : array<string|int, mixed>
- $submittedValues : array<string|int, mixed> = []
submitDataSourceForm()
Submit the data source form.
protected
submitDataSourceForm(string $csv, array<string|int, mixed> $submittedValues) : void
Parameters
- $csv : string
- $submittedValues : array<string|int, mixed>
submitPreviewForm()
Submit the preview form, triggering the import.
protected
submitPreviewForm(array<string|int, mixed> $submittedValues) : void
Parameters
- $submittedValues : array<string|int, mixed>