<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* List memberships for the UF user
*
- * return null
- * @access public
*/
- function listMemberships() {
- $membership = array();
- $dao = new CRM_Member_DAO_Membership();
+ public function listMemberships() {
+ $membership = array();
+ $dao = new CRM_Member_DAO_Membership();
$dao->contact_id = $this->_contactId;
- $dao->is_test = 0;
+ $dao->is_test = 0;
$dao->find();
while ($dao->fetch()) {
//get the membership status and type values.
$statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeValues($dao->id);
foreach (array(
- 'status', 'membership_type') as $fld) {
+ 'status',
+ 'membership_type',
+ ) as $fld) {
$membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
}
if (!empty($statusANDType[$dao->id]['is_current_member'])) {
if ($defaultRenewPageId) {
//CRM-14831 - check if membership type is present in contrib page
$memBlock = CRM_Member_BAO_Membership::getMembershipBlock($defaultRenewPageId);
- if ( !empty($memBlock['membership_types']) ) {
+ if (!empty($memBlock['membership_types'])) {
$memTypes = explode(',', $memBlock['membership_types']);
- if ( in_array($dao->membership_type_id, $memTypes) ) {
+ if (in_array($dao->membership_type_id, $memTypes)) {
$membership[$dao->id]['renewPageId'] = $defaultRenewPageId;
}
}
}
/**
- * This function is the main function that is called when the page
+ * the main function that is called when the page
* loads, it decides the which action has to be taken for the page.
*
- * return null
- * @access public
*/
- function run() {
+ public function run() {
parent::preProcess();
$this->listMemberships();
}
}
-