3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM MembershipBlock records.
15 * @package CiviCRM_APIv3
19 * API to Create or update a MembershipBlock.
21 * @param array $params
22 * An associative array of name/value property values of MembershipBlock.
27 function civicrm_api3_membership_block_create($params) {
28 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'MembershipBlock');
32 * Adjust Metadata for Create action.
34 * The metadata is used for setting defaults, documentation & validation.
36 * @param array $params
37 * Array of parameters determined by getfields.
39 function _civicrm_api3_membership_block_create_spec(&$params) {
40 $params['is_active']['api.default'] = TRUE;
41 $params['entity_id']['api.required'] = TRUE;
42 $params['entity_table']['api.default'] = 'civicrm_contribution_page';
46 * Get a Membership Block.
48 * This api is used for finding an existing membership block.
50 * @param array $params
51 * An associative array of name/value property values of civicrm_membership_block.
52 * {getfields MembershipBlock_get}
57 function civicrm_api3_membership_block_get($params) {
58 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
62 * Deletes an existing membership block.
64 * This API is used for deleting a membership block
65 * Required parameters : id of a membership block
67 * @param array $params
72 function civicrm_api3_membership_block_delete($params) {
73 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);