Merge pull request #4637 from eileenmcnaughton/CRM-15670
[civicrm-core.git] / CRM / Contribute / BAO / ContributionSoft.php
index 72ee3e765177d9858481598647acdfda108c6e2e..c0a7ac8a107ee054d12e0596a284f89ff418ad64 100644 (file)
 class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_ContributionSoft {
 
   /**
-   * construct method
+   * Construct method
    */
   function __construct() {
     parent::__construct();
   }
 
   /**
-   * function to add contribution soft credit record
+   * Add contribution soft credit record
    *
    * @param array  $params (reference ) an assoc array of name/value pairs
    *
@@ -63,16 +63,12 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
   }
 
   /**
-   * Takes a bunch of params that are needed to match certain criteria and
-   * retrieves the relevant objects. Typically the valid params are only
-   * contact_id. We'll tweak this function to be more full featured over a period
-   * of time. This is the inverse function of create. It also stores all the retrieved
-   * values in the default array
+   * 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
    *
-   * @return object CRM_Contribute_BAO_ContributionSoft object
+   * @return CRM_Contribute_BAO_ContributionSoft object
    * @access public
    * @static
    */
@@ -87,11 +83,10 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
   }
 
   /**
-   * Function to delete soft credits
+   * Delete soft credits
    *
-   * @param $params
+   * @param array $params
    *
-   * @internal param int $contributionTypeId
    * @static
    */
   static function del($params) {
@@ -103,6 +98,12 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
     $contributionSoft->delete();
   }
 
+  /**
+   * @param int $contact_id
+   * @param int $isTest
+   *
+   * @return array
+   */
   static function getSoftContributionTotals($contact_id, $isTest = 0) {
     $query = '
     SELECT SUM(amount) as amount, AVG(total_amount) as average, cc.currency
@@ -139,12 +140,11 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
   }
 
   /**
-   *  Function to retrieve soft contributions for contribution record.
+   * Retrieve soft contributions for contribution record.
    *
-   * @param $contributionID
+   * @param int $contributionID
    * @param boolean $all include PCP data
    *
-   * @internal param array $params an associated array
    * @return array of soft contribution ids, amounts, and associated contact ids
    * @static
    */
@@ -197,6 +197,12 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
     return $softContribution;
   }
 
+  /**
+   * @param int $contributionID
+   * @param bool $isPCP
+   *
+   * @return array
+   */
   static function getSoftCreditIds($contributionID , $isPCP = FALSE) {
     $query = "
   SELECT id
@@ -306,6 +312,12 @@ class CRM_Contribute_BAO_ContributionSoft extends CRM_Contribute_DAO_Contributio
    *  @static
    */
 
+  /**
+   * @param CRM_Core_Form $form
+   * @param array $params
+   * @param int $honoreeprofileId
+   * @param int $honorId
+   */
   static function formatHonoreeProfileFields($form, $params, $honoreeprofileId, $honorId = NULL) {
     $profileContactType = CRM_Core_BAO_UFGroup::getContactType($honoreeprofileId);
     $profileFields = CRM_Core_BAO_UFGroup::getFields($honoreeprofileId);