comment fixes
[civicrm-core.git] / CRM / Upgrade / Snapshot / V4p2 / Price / BAO / Set.php
index b053763d84a10424187842829297dce884ad898f..7dfdd90ef188fc247db18893499d6b48090cf3af 100644 (file)
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
  */
 
 /**
- * Business object for managing price sets
- *
+ * Business object for managing price sets.
  */
 class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set extends CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set {
 
@@ -93,14 +90,12 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Set extends CRM_Upgrade_Snapshot_V4p2_
   }
 
   /**
-   * Calculate the default price set id.
-   * assigned to the contribution/membership etc
+   * Calculate the default price set id assigned to the contribution/membership etc.
    *
    * @param string $entity
    *
    * @return int
    *   priceSetID
-   *
    */
   public static function getDefaultPriceSet($entity = 'contribution') {
     if ($entity == 'contribution') {
@@ -138,7 +133,6 @@ WHERE       ps.name = '{$entityName}'
    *
    * @return string
    *   title
-   *
    */
   public static function getTitle($id) {
     return CRM_Core_DAO::getFieldValue('CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set', $id, 'title');
@@ -255,7 +249,6 @@ WHERE     ct.id = cp.contribution_type_id AND
    * @return bool
    *   false if fields exist for this set, true if the
    *   set could be deleted
-   *
    */
   public static function deleteSet($id) {
     // remove from all inactive forms
@@ -330,7 +323,8 @@ WHERE     ct.id = cp.contribution_type_id AND
   }
 
   /**
-   * Find a price_set_id associatied with the given table, id and usedFor
+   * Find a price_set_id associated with the given details.
+   *
    * Used For value for events:1, contribution:2, membership:3
    *
    * @param string $entityTable
@@ -550,6 +544,8 @@ WHERE  id = %1";
   }
 
   /**
+   * Initialise set.
+   *
    * @param CRM_Core_Form $form
    * @param int $id
    * @param string $entityTable
@@ -651,9 +647,11 @@ WHERE  id = %1";
   }
 
   /**
-   * @param $fields
+   * Process amount.
+   *
+   * @param array $fields
    * @param array $params
-   * @param $lineItem
+   * @param array $lineItem
    */
   public static function processAmount(&$fields, &$params, &$lineItem) {
     // using price set
@@ -839,12 +837,16 @@ WHERE  id = %1";
   }
 
   /**
-   * check the current Membership
-   * having end date null.
+   * Check the current Membership.
+   *
+   * @param array $options
+   * @param int $userid
+   *
+   * @return bool
    */
   public static function checkCurrentMembership(&$options, $userid) {
     if (!$userid || empty($options)) {
-      return;
+      return FALSE;
     }
     static $_contact_memberships = array();
     $checklifetime = FALSE;
@@ -869,10 +871,10 @@ WHERE  id = %1";
   }
 
   /**
-   * Set daefult the price set fields.
+   * Set default the price set fields.
    *
    * @param CRM_Core_Form $form
-   * @param $defaults
+   * @param array $defaults
    *
    * @return array
    */
@@ -903,7 +905,6 @@ WHERE  id = %1";
    *
    * @return array
    *   Array of the field ids
-   *
    */
   public static function getFieldIds($id) {
     $priceField = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field();
@@ -916,7 +917,7 @@ WHERE  id = %1";
   }
 
   /**
-   * Copy a price set, including all the fields
+   * Copy a price set, including all the fields.
    *
    * @param int $id
    *   The price set id to copy.
@@ -963,7 +964,7 @@ WHERE  id = %1";
   }
 
   /**
-   * check price set permission.
+   * Check price set permission.
    *
    * @param int $sid
    *   The price set id.
@@ -983,8 +984,7 @@ WHERE  id = %1";
   }
 
   /**
-   * Get the sum of participant count.
-   * for all fields of given price set.
+   * Get the sum of participant count for all fields of given price set.
    *
    * @param int $sid
    *   The price set id.
@@ -1022,7 +1022,9 @@ INNER JOIN  civicrm_price_set pset    ON ( pset.id = field.price_set_id )
   }
 
   /**
-   * @param $ids
+   * Get membership count.
+   *
+   * @param array $ids
    *
    * @return array
    */
@@ -1116,6 +1118,8 @@ GROUP BY     mt.member_of_contact_id";
   }
 
   /**
+   * Get event price set for domain.
+   *
    * @return object
    */
   public static function eventPriceSetDomainID() {