update docblock for setTitle()
[civicrm-core.git] / api / api.php
index 893805895f76a165e60c38612a07500c3179c2ae..8882e8df90f85a3611cf668d8a581ca1978431c3 100644 (file)
@@ -98,16 +98,13 @@ function civicrm_error($result) {
   return FALSE;
 }
 
-function _civicrm_api_get_camel_name($entity, $version = NULL) {
-  $fragments = explode('_', $entity);
-  foreach ($fragments as & $fragment) {
-    $fragment = ucfirst($fragment);
-  }
-  // Special case: UFGroup, UFJoin, UFMatch, UFField
-  if ($fragments[0] === 'Uf') {
-    $fragments[0] = 'UF';
-  }
-  return implode('', $fragments);
+/**
+ * @param $entity
+ *
+ * @return string
+ */
+function _civicrm_api_get_camel_name($entity) {
+  return CRM_Utils_String::convertStringToCamel($entity);
 }
 
 /**