// function to format definition column
if (isset($params['definition']) && is_array($params['definition'])) {
$params['definition'] = self::convertDefinitionToXML($params['name'], $params['definition']);
+ CRM_Core_ManagedEntities::scheduleReconcilation();
}
$caseTypeDAO->copyValues($params);
return $singleton;
}
+ /**
+ * Perform an asynchronous reconciliation when the transaction ends.
+ */
+ public static function scheduleReconcilation() {
+ CRM_Core_Transaction::addCallback(
+ CRM_Core_Transaction::PHASE_POST_COMMIT,
+ function () {
+ CRM_Core_ManagedEntities::singleton(TRUE)->reconcile();
+ },
+ array(),
+ 'ManagedEntities::reconcile'
+ );
+ }
+
/**
* @param array $modules CRM_Core_Module
* @param array $declarations per hook_civicrm_managed