Move household relationship types to the processor
[civicrm-core.git] / api / v3 / Generic.php
index c4bb0c341710e1ae762f31a0c8a1985ea7e69c26..f35f84379426af6531bfce293c4b22bf9461b50e 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
@@ -172,6 +172,9 @@ function civicrm_api3_generic_getfields($apiRequest, $unique = TRUE) {
 
   // find any supplemental information
   $hypApiRequest = array('entity' => $apiRequest['entity'], 'action' => $action, 'version' => $apiRequest['version']);
+  if ($action == 'getsingle') {
+    $hypApiRequest['action'] = 'get';
+  }
   try {
     list ($apiProvider, $hypApiRequest) = \Civi::service('civi_api_kernel')->resolve($hypApiRequest);
     if (isset($hypApiRequest['function'])) {
@@ -472,6 +475,13 @@ function _civicrm_api3_generic_getoptions_spec(&$params, $apiRequest) {
       }
     }
   }
+
+  $entityName = _civicrm_api_get_entity_name_from_camel($apiRequest['entity']);
+  $getOptionsSpecFunction = '_civicrm_api3_' . $entityName . '_getoptions_spec';
+
+  if (function_exists($getOptionsSpecFunction)) {
+    $getOptionsSpecFunction($params);
+  }
 }
 
 /**