accidental debug removal
[civicrm-core.git] / CRM / Contribute / BAO / Query.php
index c026ac5f73e92d5e5fd2a3ba6ee4a38498d74c50..e2ad9a1eda0b1be6ad9a41855dbde033a5602bff 100644 (file)
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
- *
  */
 class CRM_Contribute_BAO_Query {
 
   /**
-   * Static field for all the export/import contribution fields
+   * Static field for all the export/import contribution fields.
    *
    * @var array
-   * @static
    */
   static $_contributionFields = NULL;
 
@@ -49,7 +47,6 @@ class CRM_Contribute_BAO_Query {
    *
    * @return array
    *   self::$_contributionFields  associative array of contribution fields
-   * @static
    */
   public static function &getFields() {
     if (!self::$_contributionFields) {
@@ -65,7 +62,7 @@ class CRM_Contribute_BAO_Query {
   }
 
   /**
-   * If contributions are involved, add the specific contribute fields
+   * If contributions are involved, add the specific contribute fields.
    *
    * @param $query
    *
@@ -140,7 +137,7 @@ class CRM_Contribute_BAO_Query {
 
     // get payment instrument id
     if (!empty($query->_returnProperties['payment_instrument_id'])) {
-      $query->_select['instrument_id'] =  "contribution_payment_instrument.value as instrument_id";
+      $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id";
       $query->_select['payment_instrument_id'] = "contribution_payment_instrument.value as payment_instrument_id";
       $query->_element['instrument_id'] = $query->_element['payment_instrument_id'] = 1;
       $query->_tables['civicrm_contribution'] = 1;
@@ -364,7 +361,6 @@ class CRM_Contribute_BAO_Query {
 
       case 'financial_type':
         $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fields[$name]['where'], $op, $value, 'String');
-        CRM_Core_Error::debug( '$query', $query->_where[$grouping] );
         list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contribute_DAO_Contribution', $name, $value, $op);
         $query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$name]['title'], 2 => $op, 3 => $value));
         $query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
@@ -854,13 +850,12 @@ class CRM_Contribute_BAO_Query {
   }
 
   /**
-   * Add all the elements shared between contribute search and advnaced search
+   * Add all the elements shared between contribute search and advnaced search.
    *
    *
    * @param CRM_Core_Form $form
    *
    * @return void
-   * @static
    */
   public static function buildSearchForm(&$form) {
 
@@ -879,7 +874,7 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_currency_type',
       ts('Currency Type'),
       array(
-        '' => ts('- any -')
+        '' => ts('- any -'),
       ) +
       CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')),
       FALSE, array('class' => 'crm-select2')
@@ -893,7 +888,7 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_page_id',
       ts('Contribution Page'),
       array(
-        '' => ts('- any -')
+        '' => ts('- any -'),
       ) +
       CRM_Contribute_PseudoConstant::contributionPage(),
       FALSE, array('class' => 'crm-select2')
@@ -906,7 +901,7 @@ class CRM_Contribute_BAO_Query {
     $form->add('select', 'contribution_pcp_made_through_id',
       ts('Personal Campaign Page'),
       array(
-        '' => ts('- any -')
+        '' => ts('- any -'),
       ) +
       CRM_Contribute_PseudoConstant::pcPage(),
       FALSE, array('class' => 'crm-select2')
@@ -1023,7 +1018,7 @@ class CRM_Contribute_BAO_Query {
   }
 
   /**
-   * Add the where for dates
+   * Add the where for dates.
    *
    * @param array $values
    *   Array of query values.
@@ -1041,7 +1036,7 @@ class CRM_Contribute_BAO_Query {
   public static function buildDateWhere(&$values, $query, $name, $field, $title) {
     $fieldPart = strpos($name, $field);
     if ($fieldPart === FALSE) {
-      return;
+      return NULL;
     }
     // we only have recurring dates using this ATM so lets' short cut to find the table name
     $table = 'contribution_recur';
@@ -1066,4 +1061,5 @@ class CRM_Contribute_BAO_Query {
       'contribution_recur_failure_retry_date' => ts('Failed Recurring Contribution Retry Date'),
     );
   }
+
 }