Merge pull request #4899 from colemanw/INFRA-132
[civicrm-core.git] / CRM / Pledge / BAO / Query.php
index 1b08edb1217b2c2b928ddca9d456c3f83ffeb242..273e59e4659b8b42c56183992318e37a409100d4 100644 (file)
@@ -2,7 +2,7 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -37,20 +37,19 @@ class CRM_Pledge_BAO_Query {
   /**
    * @return array
    */
-  static function &getFields() {
+  public static function &getFields() {
     $fields = CRM_Pledge_BAO_Pledge::exportableFields();
     return $fields;
   }
 
   /**
-   * build select for Pledge
+   * Build select for Pledge
    *
    * @param $query
    *
    * @return void
-   * @access public
    */
-  static function select(&$query) {
+  public static function select(&$query) {
     if (($query->_mode & CRM_Contact_BAO_Query::MODE_PLEDGE) || !empty($query->_returnProperties['pledge_id'])) {
       $query->_select['pledge_id'] = 'civicrm_pledge.id as pledge_id';
       $query->_element['pledge_id'] = 1;
@@ -103,7 +102,7 @@ class CRM_Pledge_BAO_Query {
     }
 
     if (!empty($query->_returnProperties['pledge_financial_type'])) {
-      $query->_select['pledge_financial_type']  = "(SELECT civicrm_financial_type.name FROM civicrm_financial_type WHERE civicrm_financial_type.id = civicrm_pledge.financial_type_id) as pledge_financial_type";
+      $query->_select['pledge_financial_type'] = "(SELECT civicrm_financial_type.name FROM civicrm_financial_type WHERE civicrm_financial_type.id = civicrm_pledge.financial_type_id) as pledge_financial_type";
       $query->_element['pledge_financial_type'] = 1;
       $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
     }
@@ -204,7 +203,7 @@ class CRM_Pledge_BAO_Query {
   /**
    * @param $query
    */
-  static function where(&$query) {
+  public static function where(&$query) {
     $grouping = NULL;
     foreach (array_keys($query->_params) as $id) {
       if (empty($query->_params[$id][0])) {
@@ -224,7 +223,7 @@ class CRM_Pledge_BAO_Query {
    * @param $values
    * @param $query
    */
-  static function whereClauseSingle(&$values, &$query) {
+  public static function whereClauseSingle(&$values, &$query) {
     list($name, $op, $value, $grouping, $wildcard) = $values;
 
     switch ($name) {
@@ -295,7 +294,7 @@ class CRM_Pledge_BAO_Query {
           }
         }
         else {
-          if (!empty($value) ) {
+          if (!empty($value)) {
             $names[] = $statusValues[$value];
           }
         }
@@ -337,7 +336,7 @@ class CRM_Pledge_BAO_Query {
           }
         }
         else {
-          if (!empty($value) ) {
+          if (!empty($value)) {
             $names[] = $statusValues[$value];
           }
         }
@@ -374,7 +373,7 @@ class CRM_Pledge_BAO_Query {
           $value,
           'Integer'
         );
-            $query->_qill[$grouping][] = ts( 'Financial Type - %1', array( 1 => $type ) );
+        $query->_qill[$grouping][] = ts('Financial Type - %1', array(1 => $type));
         $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
         return;
 
@@ -421,13 +420,13 @@ class CRM_Pledge_BAO_Query {
   }
 
   /**
-   * @param $name
+   * @param string $name
    * @param $mode
    * @param $side
    *
    * @return null|string
    */
-  static function from($name, $mode, $side) {
+  public static function from($name, $mode, $side) {
     $from = NULL;
 
     switch ($name) {
@@ -441,7 +440,7 @@ class CRM_Pledge_BAO_Query {
         break;
 
       case 'pledge_financial_type':
-            $from .= " $side JOIN civicrm_financial_type ON civicrm_pledge.financial_type_id = civicrm_financial_type.id ";
+        $from .= " $side JOIN civicrm_financial_type ON civicrm_pledge.financial_type_id = civicrm_financial_type.id ";
         break;
 
       case 'civicrm_pledge_payment':
@@ -462,19 +461,19 @@ class CRM_Pledge_BAO_Query {
   }
 
   /**
-   * getter for the qill object
+   * Getter for the qill object
    *
    * @return string
-   * @access public
    */
-  function qill() {
+  public function qill() {
     return (isset($this->_qill)) ? $this->_qill : "";
   }
 
   /**
    * Ideally this function should include fields that are displayed in the selector
    */
-  static function defaultReturnProperties($mode,
+  static function defaultReturnProperties(
+    $mode,
     $includeCustomFields = TRUE
   ) {
     $properties = NULL;
@@ -508,7 +507,7 @@ class CRM_Pledge_BAO_Query {
   /**
    * This includes any extra fields that might need for export etc
    */
-  static function extraReturnProperties($mode) {
+  public static function extraReturnProperties($mode) {
     $properties = NULL;
 
     if ($mode & CRM_Contact_BAO_Query::MODE_PLEDGE) {
@@ -537,9 +536,9 @@ class CRM_Pledge_BAO_Query {
   }
 
   /**
-   * @param $form
+   * @param CRM_Core_Form $form
    */
-  static function buildSearchForm(&$form) {
+  public static function buildSearchForm(&$form) {
     // pledge related dates
     CRM_Core_Form_Date::buildDateRange($form, 'pledge_start_date', 1, '_low', '_high', ts('From'), FALSE);
     CRM_Core_Form_Date::buildDateRange($form, 'pledge_end_date', 1, '_low', '_high', ts('From'), FALSE);
@@ -576,7 +575,7 @@ class CRM_Pledge_BAO_Query {
     $form->addGroup($paymentStatus, 'pledge_payment_status_id', ts('Pledge Payment Status'));
 
     $form->add('select', 'pledge_financial_type_id',
-      ts( 'Financial Type' ),
+      ts('Financial Type'),
       array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(),
       FALSE, array('class' => 'crm-select2')
     );
@@ -626,18 +625,18 @@ class CRM_Pledge_BAO_Query {
 
   /**
    * @param $row
-   * @param $id
+   * @param int $id
    */
-  static function searchAction(&$row, $id) {}
+  public static function searchAction(&$row, $id) {
+  }
 
   /**
    * @param $tables
    */
-  static function tableNames(&$tables) {
+  public static function tableNames(&$tables) {
     //add status table
     if (!empty($tables['pledge_status']) || !empty($tables['civicrm_pledge_payment'])) {
       $tables = array_merge(array('civicrm_pledge' => 1), $tables);
     }
   }
 }
-