X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fapi.php;h=be1946db3735796f65dd091d9d3aece9908d98e6;hb=0b396f84a77e2a129688af732a6233c20b799340;hp=7b9dbd77175e850577bff0a0eca013f94e519195;hpb=22bafe4e81696af3eec419d0b6ed2ad8b98d6275;p=civicrm-core.git diff --git a/api/api.php b/api/api.php index 7b9dbd7717..be1946db37 100644 --- a/api/api.php +++ b/api/api.php @@ -281,22 +281,15 @@ function _civicrm_api_replace_variable($value, $parentResult, $separator) { * * @return string * Entity name in underscore separated format. + * + * @deprecated */ function _civicrm_api_get_entity_name_from_camel($entity) { - if (!$entity || $entity === strtolower($entity)) { - return $entity; - } - elseif ($entity == 'PCP') { - return 'pcp'; - } - else { - $entity = ltrim(strtolower(str_replace('U_F', - 'uf', - // That's CamelCase, beside an odd UFCamel that is expected as uf_camel - preg_replace('/(?=[A-Z])/', '_$0', $entity) - )), '_'); + if (!$entity) { + // @todo - this should not be called when empty. + return ''; } - return $entity; + return CRM_Core_DAO_AllCoreTables::convertEntityNameToLower($entity); } /**