CRM-20199 Remove poor join on option_value table when doing contribution search.
[civicrm-core.git] / CRM / Contribute / DAO / Contribution.php
index 9d6d0f23551be1db955f8b3c9b7b8257136e4254..13d752e08122463b51da070f4c3af90cce402737 100644 (file)
  *
  * Generated from xml/schema/CRM/Contribute/Contribution.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f4c8d34b6650ac5eafbfbd3d6b8a51ca)
+ * (GenCodeChecksum:3e387ab5c998da1bbb367ed526e84289)
  */
 require_once 'CRM/Core/DAO.php';
 require_once 'CRM/Utils/Type.php';
+/**
+ * CRM_Contribute_DAO_Contribution constructor.
+ */
 class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
   /**
-   * static instance to hold the table name
+   * Static instance to hold the table name.
    *
    * @var string
    */
   static $_tableName = 'civicrm_contribution';
   /**
-   * static value to see if we should log any modifications to
-   * this table in the civicrm_log table
+   * Should CiviCRM log any modifications to this table in the civicrm_log table.
    *
    * @var boolean
    */
@@ -217,16 +219,14 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
    */
   public $revenue_recognition_date;
   /**
-   * class constructor
-   *
-   * @return civicrm_contribution
+   * Class constructor.
    */
   function __construct() {
     $this->__table = 'civicrm_contribution';
     parent::__construct();
   }
   /**
-   * Returns foreign keys and entity references
+   * Returns foreign keys and entity references.
    *
    * @return array
    *   [CRM_Core_Reference_Interface]
@@ -263,6 +263,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
         ) ,
         'contribution_contact_id' => array(
           'name' => 'contact_id',
@@ -275,6 +278,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/contact(.?id)?/i',
           'dataPattern' => '/^\d+$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'FKClassName' => 'CRM_Contact_DAO_Contact',
           'html' => array(
             'type' => 'EntityRef',
@@ -285,10 +291,13 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Financial Type') ,
           'description' => 'FK to Financial Type for (total_amount - non_deductible_amount).',
-          'export' => false,
+          'export' => true,
           'where' => 'civicrm_contribution.financial_type_id',
           'headerPattern' => '',
           'dataPattern' => '',
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'FKClassName' => 'CRM_Financial_DAO_FinancialType',
           'html' => array(
             'type' => 'Select',
@@ -309,6 +318,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
           'html' => array(
             'type' => 'Select',
@@ -322,8 +334,15 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
         'payment_instrument_id' => array(
           'name' => 'payment_instrument_id',
           'type' => CRM_Utils_Type::T_INT,
-          'title' => ts('Payment Method') ,
+          'title' => ts('Payment Method ID') ,
           'description' => 'FK to Payment Instrument',
+          'export' => true,
+          'where' => 'civicrm_contribution.payment_instrument_id',
+          'headerPattern' => '/^payment|(p(ayment\s)?instrument)$/i',
+          'dataPattern' => '',
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select',
           ) ,
@@ -342,8 +361,12 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/receive(.?date)?/i',
           'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select Date',
+            'formatType' => 'activityDateTime',
           ) ,
         ) ,
         'non_deductible_amount' => array(
@@ -360,6 +383,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/non?.?deduct/i',
           'dataPattern' => '/^\d+(\.\d{2})?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -379,6 +405,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/^total|(.?^am(ou)?nt)/i',
           'dataPattern' => '/^\d+(\.\d{2})?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -397,6 +426,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/fee(.?am(ou)?nt)?/i',
           'dataPattern' => '/^\d+(\.\d{2})?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -415,6 +447,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/net(.?am(ou)?nt)?/i',
           'dataPattern' => '/^\d+(\.\d{2})?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -431,6 +466,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/tr(ansactio|x)n(.?id)?/i',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -447,6 +485,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/invoice(.?id)?/i',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -464,6 +505,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'dataPattern' => '/^[A-Z]{3}$/i',
           'export' => true,
           'default' => 'NULL',
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select',
           ) ,
@@ -484,8 +528,12 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/cancel(.?date)?/i',
           'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select Date',
+            'formatType' => 'activityDateTime',
           ) ,
         ) ,
         'cancel_reason' => array(
@@ -497,6 +545,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/(cancel.?)?reason/i',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -511,8 +562,12 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/receipt(.?date)?/i',
           'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select Date',
+            'formatType' => 'activityDateTime',
           ) ,
         ) ,
         'thankyou_date' => array(
@@ -525,8 +580,12 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/thank(s|(.?you))?(.?date)?/i',
           'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select Date',
+            'formatType' => 'activityDateTime',
           ) ,
         ) ,
         'contribution_source' => array(
@@ -541,6 +600,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/source/i',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -554,6 +616,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -563,6 +628,13 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Recurring Contribution ID') ,
           'description' => 'Conditional foreign key to civicrm_contribution_recur id. Each contribution made in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.',
+          'export' => true,
+          'where' => 'civicrm_contribution.contribution_recur_id',
+          'headerPattern' => '',
+          'dataPattern' => '',
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'FKClassName' => 'CRM_Contribute_DAO_ContributionRecur',
         ) ,
         'is_test' => array(
@@ -574,6 +646,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'CheckBox',
           ) ,
@@ -587,6 +662,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'CheckBox',
           ) ,
@@ -601,6 +679,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'dataPattern' => '',
           'export' => true,
           'default' => '1',
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select',
           ) ,
@@ -609,14 +690,21 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
             'optionEditPath' => 'civicrm/admin/options/contribution_status',
           )
         ) ,
-        'address_id' => array(
+        'contribution_address_id' => array(
           'name' => 'address_id',
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Contribution Address') ,
           'description' => 'Conditional foreign key to civicrm_address.id. We insert an address record for each contribution when we have associated billing name and address data.',
+          'export' => true,
+          'where' => 'civicrm_contribution.address_id',
+          'headerPattern' => '',
+          'dataPattern' => '',
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'FKClassName' => 'CRM_Core_DAO_Address',
         ) ,
-        'check_number' => array(
+        'contribution_check_number' => array(
           'name' => 'check_number',
           'type' => CRM_Utils_Type::T_STRING,
           'title' => ts('Check Number') ,
@@ -627,6 +715,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/check(.?number)?/i',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -641,6 +732,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'FKClassName' => 'CRM_Campaign_DAO_Campaign',
           'html' => array(
             'type' => 'Select',
@@ -663,6 +757,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/creditnote(.?id)?/i',
           'dataPattern' => '',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -681,6 +778,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/tax(.?am(ou)?nt)?/i',
           'dataPattern' => '/^\d+(\.\d{2})?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -695,8 +795,12 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'headerPattern' => '/revenue(.?date)?/i',
           'dataPattern' => '/^\d{4}-?\d{2}-?\d{2} ?(\d{2}:?\d{2}:?(\d{2})?)?$/',
           'export' => true,
+          'table_name' => 'civicrm_contribution',
+          'entity' => 'Contribution',
+          'bao' => 'CRM_Contribute_BAO_Contribution',
           'html' => array(
             'type' => 'Select Date',
+            'formatType' => 'activityDateTime',
           ) ,
         ) ,
       );