Skip to content
Snippets Groups Projects
Commit 5ba9f99c authored by totten's avatar totten
Browse files

CRM_Utils_Migrate_Export - Add toArray()

Unlike toXML(), this can be used with alternative serializations like json_encode() or var_export()
parent 0c52a8f5
No related branches found
No related tags found
No related merge requests found
......@@ -287,6 +287,21 @@ class CRM_Utils_Migrate_Export {
return $buffer;
}
/**
* Generate an array-tree representation of the exported elements.
*
* @return array
*/
function toArray() {
$result = array();
foreach (array_keys($this->_xml) as $key) {
if (!empty($this->_xml[$key]['data'])) {
$result[ $this->_xml[$key]['name'] ] = $this->_xml[$key]['data'];
}
}
return $result;
}
function fetch($groupName, $daoName, $sql = NULL) {
$idNameFields = isset($this->_xml[$groupName]['idNameFields']) ? $this->_xml[$groupName]['idNameFields'] : NULL;
$mappedFields = isset($this->_xml[$groupName]['mappedFields']) ? $this->_xml[$groupName]['mappedFields'] : NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment