<?php
-
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
*
* This API is used for deleting a contact membership
*
- * @param $params
+ * @param array $params
* Array array holding id - Id of the contact membership to be deleted.
*
- * @return array api result
- * {@getfields membership_delete}
- * @access public
+ * @return array
+ * api result
+ * {@getfields membership_delete}
*/
function civicrm_api3_membership_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* @param array $params
* An associative array of name/value property values of civicrm_membership.
*
- * @return array of newly created membership property values.
- * {@getfields membership_create}
- * @access public
+ * @return array
+ * Array of newly created membership property values.
+ * {@getfields membership_create}
*/
function civicrm_api3_membership_create($params) {
// check params for membership id during update
// Fixme: This code belongs in the BAO
$action = CRM_Core_Action::ADD;
// we need user id during add mode
- $ids = array ();
- if (!empty($params['contact_id'])) {
- $ids['userId'] = $params['contact_id'];
- }
+ $ids = array();
+ if (!empty($params['contact_id'])) {
+ $ids['userId'] = $params['contact_id'];
+ }
//for edit membership id should be present
if (!empty($params['id'])) {
$ids['membership'] = $params['id'];
$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. By default this is 0 if id is not set and 1 if it is set.',
);
$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.',
* This api will return the membership records for the contacts
* having membership based on the relationship with the direct members.
*
- * @param Array $params
+ * @param array $params
* Key/value pairs for contact_id and some.
* options affecting the desired results; has legacy support
* for just passing the contact_id itself as the argument
*
- * @return Array of all found membership property values.
- * @access public
- * @todo needs some love - basically only a get for a given contact right now
- * {@getfields membership_get}
+ * @return array
+ * Array of all found membership property values.
*/
function civicrm_api3_membership_get($params) {
$activeOnly = $membershipTypeId = $membershipType = NULL;
$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);
}
return civicrm_api3_create_success($membershipValues, $params, 'membership', 'get');
}
- $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID );
+ $members = _civicrm_api3_membership_relationsship_get_customv2behaviour($params, $membershipValues, $contactID);
return civicrm_api3_create_success($members, $params, 'membership', 'get');
}
* @param int $membershipTypeId
* @param $activeOnly
*
- * @return array result for calling function
+ * @return array
+ * result for calling function
*/
function _civicrm_api3_membership_get_customv2behaviour(&$params, $membershipTypeId, $activeOnly) {
// get the membership for the given contact ID
* @param $membershipValues
* @param int $contactID
*
- * @return array result for calling function
+ * @return array
+ * result for calling function
*/
function _civicrm_api3_membership_relationsship_get_customv2behaviour(&$params, $membershipValues, $contactID) {
$relationships = array();