CRMTraits_Import_ParserTrait
Trait ParserTrait
Trait for testing imports.
Table of Contents
Properties
- $userJobID : int
Methods
- updateJobMetadata() : void
- Update saved userJob metadata - as the angular screen would do.
- addToDedupeRule() : void
- Enhance field such that any combo of the custom field & first/last name is enough.
- 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
updateJobMetadata()
Update saved userJob metadata - as the angular screen would do.
public
updateJobMetadata(array<string|int, mixed> $mappings, string $contactType[, array<string|int, mixed>|null $dedupeRules = null ]) : void
Parameters
- $mappings : array<string|int, mixed>
- $contactType : string
- $dedupeRules : array<string|int, mixed>|null = null
addToDedupeRule()
Enhance field such that any combo of the custom field & first/last name is enough.
protected
addToDedupeRule() : void
Tags
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 = [] ][, string $action = 'create' ][, array<string|int, mixed> $entityConfiguration = [] ]) : 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> = []
- $action : string = 'create'
- $entityConfiguration : array<string|int, mixed> = []
Tags
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>