}
}
- /**
- * @param $xml
- * @param $idMap
- */
- public function dbTemplateString(&$xml, &$idMap) {
- foreach ($xml->Persistent as $persistentXML) {
- foreach ($persistentXML->Persistent as $persistent) {
- $persistentObj = new CRM_Core_DAO_Persistent();
-
- if ($persistent->is_config == 1) {
- $persistent->data = serialize(explode(',', $persistent->data));
- }
- $this->copyData($persistentObj, $persistent, TRUE, 'context');
- }
- }
- }
-
+ /**
+ * Get Option Group ID.
+ *
+ * Returns an option group's ID, given its name.
+ *
+ * @param $groupName
+ * @param $idMap
+ *
+ * @return int|null
+ */
+ private function getOptionGroupIDFromName($groupName, &$idMap) {
+ if (empty($groupName)) {
+ return NULL;
+ }
+
+ if (!isset($idMap['option_group'][$groupName])) {
+ $idMap['option_group'][$groupName] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $groupName, 'id', 'name');
+ }
+
+ return $idMap['option_group'][$groupName];
+ }
+
/**
* @param $xml
* @param $idMap