/*
* construct method
*/
+ /**
+ * class constructor
+ *
+ * @access public
+ * @return \CRM_Contribute_DAO_Contribution
+ */
+ /**
+ *
+ */
function __construct() {
parent::__construct();
}
return self::$_importableFields;
}
+ /**
+ * @return array
+ */
static function &exportableFields() {
if (!self::$_exportableFields) {
if (!self::$_exportableFields) {
return self::$_exportableFields;
}
+ /**
+ * @param null $status
+ * @param null $startDate
+ * @param null $endDate
+ *
+ * @return array|null
+ */
static function getTotalAmountAndCount($status = NULL, $startDate = NULL, $endDate = NULL) {
$where = array();
switch ($status) {
/**
* Check if there is a contribution with the same trxn_id or invoice_id
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $duplicates (reference ) store ids of duplicate contribs
+ * @param $input
+ * @param array $duplicates (reference ) store ids of duplicate contribs
*
+ * @param null $id
+ *
+ * @internal param array $params (reference ) an assoc array of name/value pairs
* @return boolean true if duplicate, false otherwise
* @access public
* static
return $extraFields;
}
+ /**
+ * @param $pageID
+ *
+ * @return array
+ */
static function getCurrentandGoalAmount($pageID) {
$query = "
SELECT p.goal_amount as goal, sum( c.total_amount ) as total
return CRM_Core_DAO::singleValueQuery($query, CRM_Core_DAO::$_nullArray);
}
+ /**
+ * @param $contactID
+ *
+ * @return array
+ */
static function annual($contactID) {
if (is_array($contactID)) {
$contactIDs = implode(',', $contactID);
/**
* Function to create address associated with contribution record.
- * @param array $params an associated array
- * @param int $billingID $billingLocationTypeID
*
- * @return address id
- * @static
+ * @param array $params an associated array
+ * @param $billingLocationTypeID
+ *
+ * @internal param int $billingID $billingLocationTypeID
+ *
+ * @return address id
+ * @static
*/
static function createAddress(&$params, $billingLocationTypeID) {
$billingFields = array(
/**
* Delete billing address record related contribution
*
- * @param int $contact_id contact id
- * @param int $contribution_id contributionId
+ * @param null $contributionId
+ * @param null $contactId
+ *
+ * @internal param int $contact_id contact id
+ * @internal param int $contribution_id contributionId
* @access public
* @static
*/
return $componentDetails;
}
+ /**
+ * @param $contactId
+ * @param bool $includeSoftCredit
+ *
+ * @return null|string
+ */
static function contributionCount($contactId, $includeSoftCredit = TRUE) {
if (!$contactId) {
return 0;
* @param boolean $loadAll - load all related objects - even where id not passed in? (allows API to call this)
* Note that the unit test for the BaseIPN class tests this function
*/
+ /**
+ * @param $input
+ * @param $ids
+ * @param bool $required
+ * @param bool $loadAll
+ *
+ * @return bool
+ * @throws Exception
+ */
function loadRelatedObjects(&$input, &$ids, $required = FALSE, $loadAll = false) {
if($loadAll){
$ids = array_merge($this->getComponentDetails($this->id),$ids);
* function doing emails / pdfs with it
* @return array $messageArray - messages
*/
+ /**
+ * @param $input
+ * @param $ids
+ * @param $values
+ * @param bool $recur
+ * @param bool $returnMessageText
+ *
+ * @throws Exception
+ */
function composeMessageArray(&$input, &$ids, &$values, $recur = FALSE, $returnMessageText = TRUE) {
if (empty($this->_relatedObjects)) {
$this->loadRelatedObjects($input, $ids);
*
* NB don't add direct calls to the function as we intend to change the signature
*/
+ /**
+ * @param $input
+ * @param $values
+ * @param array $ids
+ *
+ * @return mixed
+ */
function _gatherMessageValues($input, &$values, $ids = array()) {
// set display address of contributor
if ($this->address_id) {
*
* @param int $contributionId contribution id
*
+ * @param bool $isNotCancelled
+ *
* @return boolean
* @access public
* @static
* @param array $params contribution object, line item array and params for trxn
*
*
+ * @param null $financialTrxnVals
+ *
+ * @return null|object
* @access public
* @static
*/
*
* @param string $context update scenarios
*
+ * @param null $skipTrxn
+ *
* @access public
* @static
*/
*
* @param array $errors list of errors
*
+ * @return bool
* @access public
* @static
*/
* @see CRM_Core_DAO::buildOptions
*
* @param String $fieldName
- * @param String $context: @see CRM_Core_DAO::buildOptionsContext
- * @param Array $props: whatever is known about this dao object
+ * @param String $context : @see CRM_Core_DAO::buildOptionsContext
+ * @param Array $props : whatever is known about this dao object
+ *
+ * @return Array|bool
*/
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
$className = __CLASS__;
*
* @param integer $financialTypeId Financial Type id
*
+ * @param string $relationName
+ *
+ * @return array|bool
* @access public
* @static
*/
* @param array $trxnData : to take user provided input of transaction details.
* @param string $paymentType 'owed' for purpose of recording partial payments, 'refund' for purpose of recording refund payments
*/
+ /**
+ * @param $contributionId
+ * @param $trxnsData
+ * @param string $paymentType
+ * @param null $participantId
+ *
+ * @return null|object
+ */
static function recordAdditionalPayment($contributionId, $trxnsData, $paymentType = 'owed', $participantId = NULL) {
$statusId = CRM_Core_OptionGroup::getValue('contribution_status', 'Completed', 'name');
$getInfoOf['id'] = $contributionId;
return $financialTrxn;
}
+ /**
+ * @param $entityObj
+ * @param $trxnObj
+ * @param $activityType
+ * @param $component
+ * @param $contributionId
+ *
+ * @throws CRM_Core_Exception
+ */
static function addActivityForPayment($entityObj, $trxnObj, $activityType, $component, $contributionId) {
if ($component == 'event') {
$date = CRM_Utils_Date::isoToMysql($trxnObj->trxn_date);
CRM_Activity_BAO_Activity::create($activityParams);
}
+ /**
+ * @param $id
+ * @param $component
+ * @param bool $getTrxnInfo
+ * @param bool $usingLineTotal
+ *
+ * @return mixed
+ */
static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $usingLineTotal = FALSE) {
if ($component == 'event') {
$entity = 'participant';
}
return $info;
}
+
+ /**
+ * Function to retreive the admin page data for contribution
+ *
+ */
+ static function getContributionSettings() {
+ $fields = array('invoice_prefix','due_date','due_date_period','notes','credit_notes_prefix','tax_display_settings');
+ foreach ($fields as $values) {
+ $fieldName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Setting',$values, 'value','name');
+ if (preg_match('/"([^"]+)"/', $fieldName, $fieldData)) {
+ $fieldValue[$values] = $fieldData[1];
+ }
+ }
+ return $fieldValue;
+ }
}