Merge pull request #19969 from eileenmcnaughton/settingbag
[civicrm-core.git] / api / v3 / Generic / Getactions.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * @package CiviCRM_APIv3
14 */
15
16 /**
17 * Get available api actions.
18 *
19 * @param array $apiRequest
20 *
21 * @return array
22 * @throws API_Exception
23 */
24 function civicrm_api3_generic_getActions($apiRequest) {
25 civicrm_api3_verify_mandatory($apiRequest, NULL, ['entity']);
26 $mfp = \Civi::service('magic_function_provider');
27 $actions = $mfp->getActionNames($apiRequest['version'], $apiRequest['entity']);
28 return civicrm_api3_create_success($actions, $apiRequest['params'], $apiRequest['entity'], 'getactions');
29 }