4 function civicrm_api3_generic_getActions($params) {
5 civicrm_api3_verify_mandatory($params, NULL, array('entity'));
6 $r = civicrm_api('Entity', 'Get', array('version' => 3));
7 $entity = CRM_Utils_String
::munge($params['entity']);
8 if (!in_array($entity, $r['values'])) {
9 return civicrm_api3_create_error("Entity " . $entity . " invalid. Use api.entity.get to have the list", array('entity' => $r['values']));
11 _civicrm_api_loadEntity($entity);
13 $functions = get_defined_functions();
15 $prefix = 'civicrm_api3_' . strtolower($entity) . '_';
16 $prefixGeneric = 'civicrm_api3_generic_';
17 foreach ($functions['user'] as $fct) {
18 if (strpos($fct, $prefix) === 0) {
19 $actions[] = substr($fct, strlen($prefix));
21 elseif (strpos($fct, $prefixGeneric) === 0) {
22 $actions[] = substr($fct, strlen($prefixGeneric));
25 return civicrm_api3_create_success($actions);