Update copyright date for 2020
[civicrm-core.git] / api / v3 / Generic / Getactions.php
CommitLineData
6a488035 1<?php
1c88e578 2/*
3 +--------------------------------------------------------------------+
fee14197 4 | CiviCRM version 5 |
b081365f 5 +--------------------------------------------------------------------+
f299f7db 6 | Copyright CiviCRM LLC (c) 2004-2020 |
b081365f
CW
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27
28/**
29 * @package CiviCRM_APIv3
e70a7fc0 30 */
6a488035 31
aa1b1481 32/**
cd5823ae
EM
33 * Get available api actions.
34 *
72b3a70c 35 * @param array $apiRequest
aa1b1481
EM
36 *
37 * @return array
38 * @throws API_Exception
39 */
c65db512 40function civicrm_api3_generic_getActions($apiRequest) {
cf8f0fff 41 civicrm_api3_verify_mandatory($apiRequest, NULL, ['entity']);
048222df 42 $mfp = \Civi::service('magic_function_provider');
82376c19 43 $actions = $mfp->getActionNames($apiRequest['version'], $apiRequest['entity']);
a14e9d08 44 return civicrm_api3_create_success($actions, $apiRequest['params'], $apiRequest['entity'], 'getactions');
6a488035 45}