Commit | Line | Data |
---|---|---|
b7c239b6 SB |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
a30c801b | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
b7c239b6 | 5 | | | |
a30c801b TO |
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 | | |
b7c239b6 SB |
9 | +--------------------------------------------------------------------+ |
10 | */ | |
11 | ||
12 | /** | |
13 | * @package CiviCRM_APIv3 | |
14 | */ | |
15 | ||
16 | /** | |
17 | * Provide meta-data for this api. | |
18 | * | |
19 | * @param array $params | |
20 | */ | |
21 | function _civicrm_api3_generic_validate_spec(&$params) { | |
22 | $params['action']['api.required'] = TRUE; | |
6e4339c4 | 23 | $params['action']['title'] = ts('API Action'); |
b7c239b6 SB |
24 | } |
25 | ||
26 | /** | |
27 | * Generic api wrapper used for validation of entity-action pair. | |
28 | * | |
29 | * @param array $apiRequest | |
30 | * | |
31 | * @return mixed | |
32 | */ | |
33 | function civicrm_api3_generic_validate($apiRequest) { | |
969ca694 | 34 | $errors = _civicrm_api3_validate($apiRequest['entity'], $apiRequest['params']['action'], $apiRequest['params']); |
b7c239b6 SB |
35 | |
36 | return civicrm_api3_create_success($errors, $apiRequest['params'], $apiRequest['entity'], 'validate'); | |
37 | } |