/**
* Add contribution soft credit record
*
- * @param array $params (reference ) an assoc array of name/value pairs
- *
- * @return object soft contribution of object that is added
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
*
+ * @return object
+ * soft contribution of object that is added
*/
public static function add(&$params) {
$contributionSoft = new CRM_Contribute_DAO_ContributionSoft();
/**
* Fetch object based on array of properties
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $defaults (reference ) an assoc array to hold the flattened values
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $defaults
+ * (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Contribute_BAO_ContributionSoft object
* @static
public static function del($params) {
//delete from contribution soft table
$contributionSoft = new CRM_Contribute_DAO_ContributionSoft();
- foreach($params as $column => $value) {
+ foreach ($params as $column => $value) {
$contributionSoft->$column = $value;
}
$contributionSoft->delete();
WHERE cc.is_test = %2 AND ccs.contact_id = %1
GROUP BY currency';
- $params = array(1 => array($contact_id, 'Integer'),
+ $params = array(
+ 1 => array($contact_id, 'Integer'),
2 => array($isTest, 'Integer'));
$cs = CRM_Core_DAO::executeQuery($query, $params);
* Retrieve soft contributions for contribution record.
*
* @param int $contributionID
- * @param boolean $all include PCP data
+ * @param bool $all
+ * Include PCP data.
*
- * @return array of soft contribution ids, amounts, and associated contact ids
+ * @return array
+ * of soft contribution ids, amounts, and associated contact ids
* @static
*/
public static function getSoftContribution($contributionID, $all = FALSE) {
'amount' => $dao->amount,
'contact_name' => $dao->display_name,
'soft_credit_type' => $dao->soft_credit_type_id,
- 'soft_credit_type_label' => CRM_Core_OptionGroup::getLabel('soft_credit_type', $dao->soft_credit_type_id)
+ 'soft_credit_type_label' => CRM_Core_OptionGroup::getLabel('soft_credit_type', $dao->soft_credit_type_id),
);
$count++;
}
*
* @return array
*/
- public static function getSoftCreditIds($contributionID , $isPCP = FALSE) {
+ public static function getSoftCreditIds($contributionID, $isPCP = FALSE) {
$query = "
SELECT id
FROM civicrm_contribution_soft
/**
* Function to retrieve the list of soft contributions for given contact.
*
- * @param int $contact_id contact id
- * @param int $isTest
- * @param string $filter additional filter criteria, later used in where clause
+ * @param int $contact_id
+ * Contact id.
+ * @param int $isTest
+ * @param string $filter
+ * Additional filter criteria, later used in where clause.
*
* @return array
* @static
$params = array(
1 => array($contact_id, 'Integer'),
- 2 => array($isTest, 'Integer')
+ 2 => array($isTest, 'Integer'),
);
$cs = CRM_Core_DAO::executeQuery($query, $params);
$contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus();
);
unset($profileFields['prefix_id']);
}
- $honorName .= ' ' . $params['first_name'] . ' ' . $params['last_name'];
- unset($profileFields['first_name']);
- unset($profileFields['last_name']);
- if (array_key_exists('suffix_id', $params)) {
- $honorName .= ' ' . CRM_Utils_Array::value(CRM_Utils_Array::value('suffix_id', $params),
+ $honorName .= ' ' . $params['first_name'] . ' ' . $params['last_name'];
+ unset($profileFields['first_name']);
+ unset($profileFields['last_name']);
+ if (array_key_exists('suffix_id', $params)) {
+ $honorName .= ' ' . CRM_Utils_Array::value(CRM_Utils_Array::value('suffix_id', $params),
CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id')
);
- unset($profileFields['suffix_id']);
- }
- break;
- case 'Organization':
- $honorName = $params['organization_name'];
- unset($profileFields['organization_name']);
- break;
- case 'Household':
- $honorName = $params['household_name'];
- unset($profileFields['household_name']);
- break;
+ unset($profileFields['suffix_id']);
+ }
+ break;
+
+ case 'Organization':
+ $honorName = $params['organization_name'];
+ unset($profileFields['organization_name']);
+ break;
+
+ case 'Household':
+ $honorName = $params['household_name'];
+ unset($profileFields['household_name']);
+ break;
}
if ($honorId) {