Clarify what getMembershipCount does
authorMatthew Wire <mjw@mjwconsult.co.uk>
Mon, 7 Sep 2020 15:32:18 +0000 (16:32 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Thu, 10 Sep 2020 10:34:05 +0000 (11:34 +0100)
CRM/Price/BAO/PriceSet.php
tests/phpunit/CRM/Price/BAO/PriceSetTest.php

index d2c1643071a2aa24f8b65f24e6ff20f2071a0a2d..7481dd09fae00d64879d4b3aadaaca7eda097a2c 100644 (file)
@@ -1234,16 +1234,20 @@ INNER JOIN  civicrm_price_set pset    ON ( pset.id = field.price_set_id )
   }
 
   /**
-   * @param $ids
+   * Return a count of priceFieldValueIDs that are memberships by organisation and membership type
+   *
+   * @param string $priceFieldValueIDs
+   *   Comma separated string of priceFieldValue IDs
    *
    * @return array
+   *   Returns an array of counts by membership organisation
    */
-  public static function getMembershipCount($ids) {
+  public static function getMembershipCount($priceFieldValueIDs) {
     $queryString = "
 SELECT       count( pfv.id ) AS count, mt.member_of_contact_id AS id
 FROM         civicrm_price_field_value pfv
 INNER JOIN    civicrm_membership_type mt ON mt.id = pfv.membership_type_id
-WHERE        pfv.id IN ( $ids )
+WHERE        pfv.id IN ( $priceFieldValueIDs )
 GROUP BY     mt.member_of_contact_id ";
 
     $crmDAO = CRM_Core_DAO::executeQuery($queryString);
index 1c311ed327f7c632b15cf31b1b27a5751556ac91..36e1e19285cce230bcf428170f797129af13de29 100644 (file)
@@ -82,7 +82,7 @@ class CRM_Price_BAO_PriceSetTest extends CiviUnitTestCase {
 
   /**
    * Test CRM_Price_BAO_PriceSet::getMembershipCount() that return correct number of
-   *   membership type occurances against it's corresponding member orgaisation
+   *   membership type occurrences against it's corresponding member organisation
    *
    * @throws \CRM_Core_Exception
    */