X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FMembership.php;h=9fc7ef29d005c62f4c35c8bf806fe6c2560c9c10;hb=1dfabac32d784af54ec7daf3259d62b254c75a94;hp=3951239c3153ccb5a28f7731d253e28a93200a55;hpb=c28e17683c9a697a035d17c26f337c2229275673;p=civicrm-core.git diff --git a/api/v3/Membership.php b/api/v3/Membership.php index 3951239c31..9fc7ef29d0 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -27,15 +27,13 @@ /** * - * This api exposes CiviCRM membership contact. + * This api exposes CiviCRM membership contact records. * * @package CiviCRM_APIv3 - * @subpackage API_Membership - * */ /** - * Deletes an existing contact membership. + * Deletes an existing contact Membership. * * @param array $params * Array array holding id - Id of the contact membership to be deleted. @@ -133,7 +131,7 @@ function civicrm_api3_membership_create($params) { $membership = array(); _civicrm_api3_object_to_array($membershipBAO, $membership[$membershipBAO->id]); - return civicrm_api3_create_success($membership, $params, 'membership', 'create', $membershipBAO); + return civicrm_api3_create_success($membership, $params, 'Membership', 'create', $membershipBAO); } @@ -143,7 +141,7 @@ function civicrm_api3_membership_create($params) { * The metadata is used for setting defaults, documentation & validation. * * @param array $params - * Array or parameters determined by getfields. + * Array of parameters determined by getfields. */ function _civicrm_api3_membership_create_spec(&$params) { $params['contact_id']['api.required'] = 1; @@ -152,10 +150,13 @@ function _civicrm_api3_membership_create_spec(&$params) { $params['membership_type_id']['api.aliases'] = array('membership_type'); $params['status_id']['api.aliases'] = array('membership_status'); $params['skipStatusCal'] = array( - 'title' => 'Skip status calculation. By default this is 0 if id is not set and 1 if it is set.', + 'title' => 'Skip status calculation', + 'description' => 'By default this is 0 if id is not set and 1 if it is set.', + 'type' => CRM_Utils_Type::T_BOOLEAN, ); $params['num_terms'] = array( - 'title' => 'Number of terms to add/renew. If this parameter is passed, dates will be calculated automatically. If no id is passed (new membership) and no dates are given, num_terms will be assumed to be 1.', + 'title' => 'Number of terms', + 'description' => 'Terms to add/renew. If this parameter is passed, dates will be calculated automatically. If no id is passed (new membership) and no dates are given, num_terms will be assumed to be 1.', 'type' => CRM_Utils_Type::T_INT, ); } @@ -166,18 +167,19 @@ function _civicrm_api3_membership_create_spec(&$params) { * The metadata is used for setting defaults, documentation & validation. * * @param array $params - * Array or parameters determined by getfields. + * Array of parameters determined by getfields. */ function _civicrm_api3_membership_get_spec(&$params) { $params['membership_type_id']['api.aliases'] = array('membership_type'); $params['active_only'] = array( - 'title' => 'Only retrieve active memberships', + 'title' => 'Active Only', + 'description' => 'Only retrieve active memberships', 'type' => CRM_Utils_Type::T_BOOLEAN, ); } /** - * Get contact membership record. + * Get contact Membership record. * * This api will return the membership records for the contacts * having membership based on the relationship with the direct members. @@ -203,7 +205,7 @@ function civicrm_api3_membership_get($params) { $params['status_id'] = array('IN' => CRM_Member_BAO_MembershipStatus::getMembershipStatusCurrent()); } - $options = _civicrm_api3_get_options_from_params($params, TRUE, 'membership', 'get'); + $options = _civicrm_api3_get_options_from_params($params, TRUE, 'Membership', 'get'); if ($options['is_count']) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } @@ -216,11 +218,11 @@ function civicrm_api3_membership_get($params) { && !array_key_exists('relationship_name', $return) ) ) { - return civicrm_api3_create_success($membershipValues, $params, 'membership', 'get'); + return civicrm_api3_create_success($membershipValues, $params, 'Membership', 'get'); } $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID); - return civicrm_api3_create_success($members, $params, 'membership', 'get'); + return civicrm_api3_create_success($members, $params, 'Membership', 'get'); } /**