Skip to content
Snippets Groups Projects
Commit 8b4292a8 authored by Tim Otten's avatar Tim Otten
Browse files

Merge pull request #1149 from totten/master-profile-export

CRM_Utils_Migrate_Export - Allow export of specific UFGroups
parents 19a6c523 a304337b
No related branches found
No related tags found
No related merge requests found
......@@ -316,6 +316,43 @@ class CRM_Utils_Migrate_Export {
$this->fetch('customField', 'CRM_Core_DAO_CustomField', $sql);
}
/**
* @param array $ufGroupIds list of custom groups to export
* @return void
*/
function buildUFGroups($ufGroupIds) {
$ufGroupIdsSql = implode(',', array_filter($ufGroupIds, 'is_numeric'));
if (empty($ufGroupIdsSql)) {
return;
}
$sql = "
SELECT cg.*
FROM civicrm_uf_group cg
WHERE cg.id IN ($ufGroupIdsSql)
";
$this->fetch('profileGroup', 'CRM_Core_DAO_UFGroup', $sql);
$sql = "
SELECT f.*
FROM civicrm_uf_field f,
civicrm_uf_group cg
WHERE f.uf_group_id = cg.id
AND cg.id IN ($ufGroupIdsSql)
";
$this->fetch('profileField', 'CRM_Core_DAO_UFField', $sql);
$sql = "
SELECT *
FROM civicrm_uf_join
WHERE entity_table IS NULL
AND entity_id IS NULL
AND uf_group_id IN ($ufGroupIdsSql)
";
$this->fetch('profileJoin', 'CRM_Core_DAO_UFJoin', $sql);
}
/**
* Render the in-memory representation as XML
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment