CRM_Contact_Import_Parser
class CRM_Contact_Import_Parser extends CRM_Import_Parser
Constants
MAX_ERRORS |
Settings |
MAX_WARNINGS |
Settings |
DEFAULT_TIMEOUT |
Settings |
VALID |
Return codes |
WARNING |
Return codes |
ERROR |
Return codes |
CONFLICT |
Return codes |
STOP |
Return codes |
DUPLICATE |
Return codes |
MULTIPLE_DUPE |
Return codes |
NO_MATCH |
Return codes |
UNPARSED_ADDRESS_WARNING |
Return codes |
MODE_MAPFIELD |
Parser modes |
MODE_PREVIEW |
Parser modes |
MODE_SUMMARY |
Parser modes |
MODE_IMPORT |
Parser modes |
DUPLICATE_SKIP |
Codes for duplicate record handling |
DUPLICATE_REPLACE |
Codes for duplicate record handling |
DUPLICATE_UPDATE |
Codes for duplicate record handling |
DUPLICATE_FILL |
Codes for duplicate record handling |
DUPLICATE_NOCHECK |
Codes for duplicate record handling |
CONTACT_INDIVIDUAL |
Contact types |
CONTACT_HOUSEHOLD |
Contact types |
CONTACT_ORGANIZATION |
Contact types |
Properties
protected | $_totalCount | Total number of non empty lines | from CRM_Import_Parser |
protected | $_validCount | Running total number of valid lines | from CRM_Import_Parser |
protected | $_invalidRowCount | Running total number of invalid rows | from CRM_Import_Parser |
protected int | $_maxLinesToProcess | Maximum number of non-empty/comment lines to process | from CRM_Import_Parser |
protected | $_maxErrorCount | Maximum number of invalid rows to store | from CRM_Import_Parser |
protected | $_errors | Array of error lines, bounded by MAX_ERROR | from CRM_Import_Parser |
protected | $_conflictCount | Total number of conflict lines | from CRM_Import_Parser |
protected | $_conflicts | Array of conflict lines | from CRM_Import_Parser |
protected | $_duplicateCount | Total number of duplicate (from database) lines | from CRM_Import_Parser |
protected | $_duplicates | Array of duplicate lines | from CRM_Import_Parser |
protected | $_warningCount | Running total number of warnings | from CRM_Import_Parser |
protected | $_maxWarningCount | Maximum number of warnings to store | from CRM_Import_Parser |
protected | $_warnings | Array of warning lines, bounded by MAX_WARNING | from CRM_Import_Parser |
protected array | $_fields | Array of all the fields that could potentially be part of this import process | from CRM_Import_Parser |
protected array | $_activeFields | Array of the fields that are actually part of the import process the position in the array also dictates their position in the import file | from CRM_Import_Parser |
protected int | $_activeFieldCount | Cache the count of active fields | from CRM_Import_Parser |
protected array | $_rows | Cache of preview rows | from CRM_Import_Parser |
protected string | $_errorFileName | Filename of error data | from CRM_Import_Parser |
protected string | $_conflictFileName | Filename of conflict data | from CRM_Import_Parser |
protected string | $_duplicateFileName | Filename of duplicate data | from CRM_Import_Parser |
int | $_contactType | Contact type | from CRM_Import_Parser |
int | $_contactSubType | Contact sub-type | from CRM_Import_Parser |
protected | $_tableName | ||
protected integer | $_rowCount | Total number of lines in file | |
protected | $_unMatchCount | Running total number of un-matched Contacts. | |
protected | $_unMatch | Array of unmatched lines | |
protected | $_unparsedAddressCount | Total number of contacts with unparsed addresses | |
protected string | $_misMatchFilemName | Filename of mismatch data | |
protected | $_primaryKeyName | ||
protected | $_statusFieldName | ||
int | $_onDuplicate | On duplicate | |
int | $_dedupeRuleGroupID | Dedupe rule group id to use if set |
Methods
Set and validate field values.
Format the field values for input to the api.
Remove single-quote enclosures from a value array (row).
Determines the file extension based on error code.
Determines the file name based on error code.
Run import.
Given a list of the importable field keys that the user has selected.
No description
No description
No description
Set IM Service Provider type fields.
No description
No description
No description
No description
Set active field for related contact's phone type.
No description
Set IM Service Provider type fields for related contacts.
No description
No description
Export data to a CSV file.
Update the record with PK $id in the import database table.
Details
in CRM_Import_Parser at line 193
__construct()
Class constructor.
in CRM_Import_Parser at line 201
abstract protected
init()
Abstract function definitions.
in CRM_Import_Parser at line 206
abstract protected mixed
fini()
in CRM_Import_Parser at line 215
abstract protected mixed
mapField(array $values)
Map field.
in CRM_Import_Parser at line 224
abstract protected mixed
preview(array $values)
Preview.
in CRM_Import_Parser at line 231
abstract protected mixed
summary($values)
in CRM_Import_Parser at line 239
abstract protected mixed
import($onDuplicate, $values)
in CRM_Import_Parser at line 251
int
setActiveFieldValues(array $elements, $erroneousField)
Set and validate field values.
at line 533
array
getActiveFieldParams()
Format the field values for input to the api.
in CRM_Import_Parser at line 298
array
getSelectValues()
in CRM_Import_Parser at line 309
array
getSelectTypes()
in CRM_Import_Parser at line 322
array
getHeaderPatterns()
in CRM_Import_Parser at line 335
array
getDataPatterns()
in CRM_Import_Parser at line 351
static void
encloseScrub(array $values, string $enclosure = "'")
Remove single-quote enclosures from a value array (row).
in CRM_Import_Parser at line 368
void
setMaxLinesToProcess(int $max)
Setter function.
in CRM_Import_Parser at line 378
static string
errorFileName($type)
Determines the file extension based on error code.
in CRM_Import_Parser at line 417
static string
saveFileName($type)
Determines the file name based on error code.
at line 102
mixed
run(string $tableName, array $mapper, int $mode = self::MODE_PREVIEW, int $contactType = self::CONTACT_INDIVIDUAL, string $primaryKeyName = '_id', string $statusFieldName = '_status', int $onDuplicate = self::DUPLICATE_SKIP, int $statusID = NULL, int $totalRowCount = NULL, bool $doGeocodeAddress = FALSE, int $timeout = CRM_Contact_Import_Parser::DEFAULT_TIMEOUT, string $contactSubType = NULL, int $dedupeRuleGroupID = NULL)
Run import.
at line 405
setActiveFields(array $fieldKeys)
Given a list of the importable field keys that the user has selected.
set the active fields array to this list
at line 420
setActiveFieldLocationTypes($elements)
at line 432
setActiveFieldPhoneTypes($elements)
at line 441
setActiveFieldWebsiteTypes($elements)
at line 453
setActiveFieldImProviders(array $elements)
Set IM Service Provider type fields.
at line 462
setActiveFieldRelated($elements)
at line 471
setActiveFieldRelatedContactType($elements)
at line 480
setActiveFieldRelatedContactDetails($elements)
at line 489
setActiveFieldRelatedContactLocType($elements)
at line 500
setActiveFieldRelatedContactPhoneType(array $elements)
Set active field for related contact's phone type.
at line 509
setActiveFieldRelatedContactWebsiteType($elements)
at line 521
setActiveFieldRelatedContactImProvider(array $elements)
Set IM Service Provider type fields for related contacts.
at line 629
array
getColumnPatterns()
at line 645
addField(string $name, $title, int $type = CRM_Utils_Type::T_INT, string $headerPattern = '//', string $dataPattern = '//', bool $hasLocationType = FALSE)
at line 663
set(CRM_Core_Session $store, int $mode = self::MODE_SUMMARY)
Store parser values.
at line 725
static
exportCSV(string $fileName, array $header, array $data)
Export data to a CSV file.
at line 770
updateImportRecord(int $id, array $params)
Update the record with PK $id in the import database table.