CRM-14139 Group Selector Code - make static functions static
authorEileen McNaughton <eileen@fuzion.co.nz>
Tue, 28 Jan 2014 17:54:48 +0000 (06:54 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Tue, 28 Jan 2014 17:54:48 +0000 (06:54 +1300)
----------------------------------------
* CRM-14139: Static methods called non-statically
  http://issues.civicrm.org/jira/browse/CRM-14139

CRM/Contact/BAO/Group.php

index 9a18004208d9bc4ca239ab55688fb253b9ea64e3..7184d8ca4944e0682a998958beb046e913b2b919 100644 (file)
@@ -674,9 +674,13 @@ class CRM_Contact_BAO_Group extends CRM_Contact_DAO_Group {
    * @param  array   $params associated array for params record id.
    *
    * @return array   $groupList associated array of group list
+   *  -rp = rowcount
+   *  -page= offset
+   *  @todo there seems little reason for the small number of functions that call this to pass in
+   *  params that then need to be translated in this function since they are coding them when calling
    * @access public
    */
-  public function getGroupListSelector(&$params) {
+  static public function getGroupListSelector(&$params) {
     // format the params
     $params['offset']   = ($params['page'] - 1) * $params['rp'];
     $params['rowCount'] = $params['rp'];
@@ -1043,7 +1047,7 @@ WHERE {$whereClause}";
     return CRM_Core_DAO::singleValueQuery($query, $params);
   }
 
-  function whereClause(&$params, $sortBy = TRUE, $excludeHidden = TRUE) {
+  static function whereClause(&$params, $sortBy = TRUE, $excludeHidden = TRUE) {
     $values = array();
     $clauses = array();