CRM_Utils_Migrate_Export
in package
Tags
Table of Contents
Constants
- XML_VALUE_SEPARATOR = ":;:;:;"
Properties
- $_xml : array<string|int, mixed>
Methods
- __construct() : mixed
- Class constructor.
- build() : mixed
- Scan local customizations and build an in-memory representation.
- buildCustomGroups() : mixed
- Build custom groups.
- buildUFGroups() : mixed
- computeMappedFields() : array<string|int, mixed>
- Compute any fields of the entity defined by the $mappedFields specification
- exportDAO() : array<string|int, mixed>
- fetch() : mixed
- renderKeyValueXML() : string
- renderTextTag() : string
- toArray() : array<string|int, mixed>
- Generate an array-tree representation of the exported elements.
- toXML() : string
- Render the in-memory representation as XML
Constants
XML_VALUE_SEPARATOR
public
mixed
XML_VALUE_SEPARATOR
= ":;:;:;"
Properties
$_xml
protected
array<string|int, mixed>
$_xml
Description of export field mapping
'exampleEntityMappingName' => array(
'data' => array(), // placeholder; this will get filled-in during execution
'name' => 'CustomGroup', // per-item XML tag name
'scope' => 'CustomGroups', // container XML tag name
'required' => FALSE, // whether we *must* find records of this type
'idNameFields' => array('id', 'name'), // name of the (local/autogenerated) "id" and (portable) "name" columns
'idNameMap' => array(), // placeholder; this will get filled-in during execution
),
Methods
__construct()
Class constructor.
public
__construct() : mixed
build()
Scan local customizations and build an in-memory representation.
public
build() : mixed
buildCustomGroups()
Build custom groups.
public
buildCustomGroups(array<string|int, mixed> $customGroupIds) : mixed
Parameters
- $customGroupIds : array<string|int, mixed>
-
List of custom groups to export.
buildUFGroups()
public
buildUFGroups(array<string|int, mixed> $ufGroupIds) : mixed
Parameters
- $ufGroupIds : array<string|int, mixed>
-
List of custom groups to export.
computeMappedFields()
Compute any fields of the entity defined by the $mappedFields specification
public
computeMappedFields(array<string|int, mixed> $mappedFields, CRM_Core_DAO $dao) : array<string|int, mixed>
Parameters
- $mappedFields : array<string|int, mixed>
-
Each item is an array(0 => MappedEntityname, 1 => InputFieldName (id-field), 2 => OutputFieldName (name-field), 3 => OptionalPrefix).
- $dao : CRM_Core_DAO
-
The entity for which we want to prepare mapped fields.
Return values
array<string|int, mixed> —new fields
exportDAO()
public
exportDAO(string $objectName, CRM_Core_DAO $object, array<string|int, mixed> $mappedFields) : array<string|int, mixed>
Parameters
- $objectName : string
-
Business-entity/xml-tag name.
- $object : CRM_Core_DAO
- $mappedFields : array<string|int, mixed>
Return values
array<string|int, mixed>fetch()
public
fetch(string $groupName, string $daoName[, string $sql = NULL ]) : mixed
Parameters
- $groupName : string
- $daoName : string
- $sql : string = NULL
renderKeyValueXML()
public
renderKeyValueXML(string $tagName, array<string|int, mixed> $keyValues) : string
Parameters
- $tagName : string
- $keyValues : array<string|int, mixed>
Tags
Return values
string —XML
renderTextTag()
public
renderTextTag(string $name, string $value[, string $prefix = '' ]) : string
Parameters
- $name : string
-
Tag name.
- $value : string
-
Text.
- $prefix : string = ''
Tags
Return values
string —XML
toArray()
Generate an array-tree representation of the exported elements.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toXML()
Render the in-memory representation as XML
public
toXML() : string
Tags
Return values
string —XML