Merge pull request #17522 from seamuslee001/remove_deprecated_methods
[civicrm-core.git] / api / v3 / MembershipBlock.php
CommitLineData
f64a217a 1<?php
f64a217a
EM
2/*
3 +--------------------------------------------------------------------+
a30c801b 4 | Copyright CiviCRM LLC. All rights reserved. |
f64a217a 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 |
f64a217a 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
f64a217a
EM
11
12/**
244bbdd8 13 * This api exposes CiviCRM MembershipBlock records.
f64a217a
EM
14 *
15 * @package CiviCRM_APIv3
f64a217a
EM
16 */
17
18/**
244bbdd8 19 * API to Create or update a MembershipBlock.
f64a217a 20 *
37fa58b0 21 * @param array $params
244bbdd8 22 * An associative array of name/value property values of MembershipBlock.
f64a217a 23 *
a6c01b45 24 * @return array
00f8641b 25 * API result array
f64a217a
EM
26 */
27function civicrm_api3_membership_block_create($params) {
ddaf2161 28 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'MembershipBlock');
f64a217a
EM
29}
30
31/**
0aa0303c
EM
32 * Adjust Metadata for Create action.
33 *
34 * The metadata is used for setting defaults, documentation & validation.
f64a217a 35 *
cf470720 36 * @param array $params
b081365f 37 * Array of parameters determined by getfields.
f64a217a
EM
38 */
39function _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';
43}
44
45/**
c28e1768 46 * Get a Membership Block.
f64a217a 47 *
c28e1768 48 * This api is used for finding an existing membership block.
f64a217a 49 *
cf470720
TO
50 * @param array $params
51 * An associative array of name/value property values of civicrm_membership_block.
f64a217a
EM
52 * {getfields MembershipBlock_get}
53 *
a6c01b45 54 * @return array
00f8641b 55 * API result array
f64a217a
EM
56 */
57function civicrm_api3_membership_block_get($params) {
58 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
59}
60
61/**
c28e1768 62 * Deletes an existing membership block.
f64a217a 63 *
c28e1768
CW
64 * This API is used for deleting a membership block
65 * Required parameters : id of a membership block
f64a217a 66 *
cf470720 67 * @param array $params
f64a217a 68 *
a6c01b45 69 * @return array
00f8641b 70 * API result array
f64a217a
EM
71 */
72function civicrm_api3_membership_block_delete($params) {
73 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
74}