$action = CRM_Core_Action::ADD;
// we need user id during add mode
$ids = array ();
- if(CRM_Utils_Array::value('contact_id', $params)) {
+ if (!empty($params['contact_id'])) {
$ids['userId'] = $params['contact_id'];
}
//for edit membership id should be present
- if (CRM_Utils_Array::value('id', $params)) {
+ if (!empty($params['id'])) {
$ids['membership'] = $params['id'];
$action = CRM_Core_Action::UPDATE;
}
'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.'
+ '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.',
+ 'type' => CRM_Utils_Type::T_INT,
);
}
/**
}
$activeOnly = CRM_Utils_Array::value('active_only', $params, $activeOnly);
- if (CRM_Utils_Array::value('contact_id', $params) && !is_array($params['contact_id'])) {
+ if (!empty($params['contact_id']) && !is_array($params['contact_id'])) {
$membershipValues = _civicrm_api3_membership_get_customv2behaviour($params, $membershipTypeId, $activeOnly );
}
else {
$membershipValues[$membershipId]['membership_name'] = $membershipType['name'];
- if (CRM_Utils_Array::value('relationship_type_id', $membershipType)) {
+ if (!empty($membershipType['relationship_type_id'])) {
$relationships[$membershipType['relationship_type_id']] = $membershipId;
}