| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* Boolean Return FALSE if the relevant objects don't exist.
* @param int $paymentProcessorID
* Id of the payment processor ID in use.
- * @return boolean
+ * @return bool
*/
public function validateData(&$input, &$ids, &$objects, $required = TRUE, $paymentProcessorID = NULL) {
* @param int $paymentProcessorID
* @param array $error_handling
*
- * @return boolean
+ * @return bool
*/
public function loadObjects(&$input, &$ids, &$objects, $required, $paymentProcessorID, $error_handling = NULL) {
if (empty($error_handling)) {
CRM_Core_Error::debug_log_message($e->getMessage());
}
if (!empty($error_handling['echo_error'])) {
- echo($e->getMessage());
+ echo $e->getMessage();
}
if (!empty($error_handling['return_error'])) {
return array(
* @param array $objects
* @param object $transaction
* @param array $input
- * @return boolean
+ * @return bool
*/
public function failed(&$objects, &$transaction, $input = array()) {
$contribution = &$objects['contribution'];
//CRM-15546
$contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$contribution->receive_date = CRM_Utils_Date::isoToMysql($contribution->receive_date);
$contribution->receipt_date = CRM_Utils_Date::isoToMysql($contribution->receipt_date);
// if transaction is failed then set "Cancelled" as membership status
$membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
foreach ($memberships as $membership) {
if ($membership) {
if ($participant) {
$participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$participant->status_id = $participantStatuses['Cancelled'];
$participant->save();
* Handled pending contribution status
* @param array $objects
* @param object $transaction
- * @return boolean
+ * @return bool
*/
public function pending(&$objects, &$transaction) {
$transaction->commit();
}
$contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$contribution->contribution_status_id = $contributionStatuses['Cancelled'];
$contribution->cancel_date = self::$_now;
if (!empty($memberships)) {
$membershipStatuses = CRM_Core_PseudoConstant::get('CRM_Member_DAO_Membership', 'status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
foreach ($memberships as $membership) {
if ($membership) {
if ($participant) {
$participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$participant->status_id = $participantStatuses['Cancelled'];
$participant->save();
WHERE membership_id=$membership->id
ORDER BY id DESC
LIMIT 1;";
- $dao = new CRM_Core_DAO;
+ $dao = new CRM_Core_DAO();
$dao->query($sql);
if ($dao->fetch()) {
if (!empty($dao->membership_type_id)) {
if (empty($input['skipComponentSync'])) {
$participantStatuses = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$participant->status_id = $participantStatuses['Registered'];
}
}
$contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$contribution->contribution_status_id = $contributionStatuses['Completed'];
$contribution->is_test = $input['is_test'];
if ($contribution->id) {
$contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
- if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && -$input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
+ if ((empty($input['prevContribution']) && $paymentProcessorId) || (!$input['prevContribution']->is_pay_later && $input['prevContribution']->contribution_status_id == $contributionStatuses['Pending'])) {
$input['payment_processor'] = $paymentProcessorId;
}
$input['contribution_status_id'] = $contributionStatuses['Completed'];
* Is it part of a recurring contribution.
* @param bool $returnMessageText
* Should text be returned instead of sent. This.
- * is because the function is also used to generate pdfs
+ * is because the function is also used to generate pdfs
*
* @return array
*/
* Update contribution status - this is only called from one place in the code &
* it is unclear whether it is a function on the way in or on the way out
*
- * @param unknown_type $params
- * @return void|Ambigous <value, unknown, array>
+ * @param array $params
+ * @return void|NULL|int
*/
public function updateContributionStatus(&$params) {
// get minimum required values.
$contributionId = CRM_Utils_Array::value('contribution_id', $params);
if (!$contributionId || !$componentId || !$componentName || !$statusId) {
- return;
+ return NULL;
}
$input = $ids = $objects = array();
$contributionStatuses = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status_id', array(
'labelColumn' => 'name',
- 'flip' => 1
+ 'flip' => 1,
));
$input['skipComponentSync'] = CRM_Utils_Array::value('skipComponentSync', $params);
if ($statusId == $contributionStatuses['Cancelled']) {
foreach (array(
'fee_amount',
'check_number',
- 'payment_instrument_id'
+ 'payment_instrument_id',
) as $field) {
if (!$input[$field] = CRM_Utils_Array::value($field, $params)) {
$input[$field] = $contribution->$field;
return $statusId;
}
- /*
+ /**
* Update pledge associated with a recurring contribution
*
* If the contribution has a pledge_payment record pledge, then update the pledge_payment record & pledge based on that linkage.
*
* The pledge payment record should already exist & will need to be updated with the new contribution ID.
* If not the contribution will also need to be linked to the pledge
- */
- /**
- * @param $contribution
+ *
+ * @param CRM_Contribute_BAO_Contribution $contribution
*/
public function updateRecurLinkedPledge(&$contribution) {
$returnProperties = array('id', 'pledge_id');
try {
civicrm_api3('membership_payment', 'create', array(
'membership_id' => $value['entity_id'],
- 'contribution_id' => $contribution->id
+ 'contribution_id' => $contribution->id,
));
}
catch (CiviCRM_API3_Exception $e) {
return $lineSets;
}
- // function to copy custom data of the
- // initial contribution into its recurring contributions
/**
+ * copy custom data of the initial contribution into its recurring contributions
* @param int $recurId
* @param int $targetContributionId
*/
}
}
- // function to copy soft credit record of first recurring contribution
- // and add new soft credit against $targetContributionId
/**
+ * copy soft credit record of first recurring contribution
+ * and add new soft credit against $targetContributionId
+ *
* @param int $recurId
* @param int $targetContributionId
*/
$soft_contribution->save();
}
}
+
}