public static $_signupActType = NULL;
- /**
- * Class constructor.
- */
- public function __construct() {
- parent::__construct();
- }
-
/**
* Takes an associative array and creates a membership object.
*
* @param array $values
* Output values of the object.
* @param bool $active
- * Do you want only active memberships to.
- * be returned
+ * Return only memberships with an 'is_current_member' status.
*
- * @return CRM_Member_BAO_Membership|null
- * The found object or null
+ * @return CRM_Member_BAO_Membership[]|null
*/
- public static function &getValues(&$params, &$values, $active = FALSE) {
+ public static function getValues($params, &$values, $active = FALSE) {
if (empty($params)) {
return NULL;
}
else {
$calcDates = [];
}
- $params['start_date'] = $params['start_date'] ?? ($calcDates['start_date'] ?? 'null');
- $params['end_date'] = $params['end_date'] ?? ($calcDates['end_date'] ?? 'null');
- $params['join_date'] = $params['join_date'] ?? ($calcDates['join_date'] ?? 'null');
+ $params['start_date'] = empty($params['start_date']) ? ($calcDates['start_date'] ?? 'null') : $params['start_date'];
+ $params['end_date'] = empty($params['end_date']) ? ($calcDates['end_date'] ?? 'null') : $params['end_date'];
+ $params['join_date'] = empty($params['join_date']) ? ($calcDates['join_date'] ?? 'null') : $params['join_date'];
//fix for CRM-3570, during import exclude the statuses those having is_admin = 1
$excludeIsAdmin = $params['exclude_is_admin'] ?? FALSE;
$transaction = new CRM_Core_Transaction();
- $results = NULL;
//delete activity record
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'name');
* @param int $ownerMembershipId
* @param int $contactId
*
- * @return null
+ * @return void
*/
public static function deleteRelatedMemberships($ownerMembershipId, $contactId = NULL) {
if (!$ownerMembershipId && !$contactId) {
- return FALSE;
+ return;
}
$membership = new CRM_Member_DAO_Membership();
* @param string $status
* Active or inactive.
*
- * @return array
+ * @return array|null
* array of memberships based on status
*/
public static function activeMembers($memberships, $status = 'active') {
* @param bool $all
* if more than one payment associated with membership id need to be returned.
*
- * @return int|int[]
+ * @return int|int[]|null
* contribution id
* @todo we should get this off the line item
*
*/
public static function getMembershipContributionId($membershipId, $all = FALSE) {
-
$membershipPayment = new CRM_Member_DAO_MembershipPayment();
$membershipPayment->membership_id = $membershipId;
if ($all && $membershipPayment->find()) {
AND {$membershipStatusClause}
AND civicrm_membership.owner_membership_id IS NULL ";
- $allMembershipTypes = CRM_Member_BAO_MembershipType::getAllMembershipTypes();
-
$dao2 = CRM_Core_DAO::executeQuery($query, $queryParams);
while ($dao2->fetch()) {
// CRM-7248: added excludeIsAdmin param to the following fn call to prevent moving to admin statuses
//get the membership status as per id.
- $newStatus = civicrm_api3('membership_status', 'calc',
- [
- 'membership_id' => $dao2->membership_id,
- 'ignore_admin_only' => TRUE,
- ], TRUE
- );
+ $newStatus = civicrm_api3('membership_status', 'calc', [
+ 'membership_id' => $dao2->membership_id,
+ 'ignore_admin_only' => TRUE,
+ ]);
$statusId = $newStatus['id'] ?? NULL;
//process only when status change.