Merge pull request #9668 from colemanw/CRM-19864
[civicrm-core.git] / CRM / Batch / DAO / Batch.php
index ee02f29bc32efe736def8d2152d38f4266b9fb88..14ed8afb134ecb719a5b5385e9d458c95d5cd369 100644 (file)
@@ -3,7 +3,7 @@
 +--------------------------------------------------------------------+
 | CiviCRM version 4.7                                                |
 +--------------------------------------------------------------------+
-| Copyright CiviCRM LLC (c) 2004-2016                                |
+| Copyright CiviCRM LLC (c) 2004-2017                                |
 +--------------------------------------------------------------------+
 | This file is a part of CiviCRM.                                    |
 |                                                                    |
 */
 /**
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
  *
  * Generated from xml/schema/CRM/Batch/Batch.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:81081e8ad03b0097ba7949b4425b1ca8)
+ * (GenCodeChecksum:d02020e92b997906c5591971b4c4b988)
  */
 require_once 'CRM/Core/DAO.php';
 require_once 'CRM/Utils/Type.php';
+/**
+ * CRM_Batch_DAO_Batch constructor.
+ */
 class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
   /**
-   * static instance to hold the table name
+   * Static instance to hold the table name.
    *
    * @var string
    */
   static $_tableName = 'civicrm_batch';
   /**
-   * static instance to hold the field values
-   *
-   * @var array
-   */
-  static $_fields = null;
-  /**
-   * static instance to hold the FK relationships
-   *
-   * @var string
-   */
-  static $_links = null;
-  /**
-   * 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
    */
@@ -162,28 +152,27 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
    */
   public $data;
   /**
-   * class constructor
-   *
-   * @return civicrm_batch
+   * Class constructor.
    */
   function __construct() {
     $this->__table = 'civicrm_batch';
     parent::__construct();
   }
   /**
-   * Returns foreign keys and entity references
+   * Returns foreign keys and entity references.
    *
    * @return array
    *   [CRM_Core_Reference_Interface]
    */
   static function getReferenceColumns() {
-    if (!self::$_links) {
-      self::$_links = static ::createReferenceColumns(__CLASS__);
-      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
-      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id');
-      self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
+    if (!isset(Civi::$statics[__CLASS__]['links'])) {
+      Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
+      Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
+      Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id');
+      Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
+      CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
     }
-    return self::$_links;
+    return Civi::$statics[__CLASS__]['links'];
   }
   /**
    * Returns all the column names of this table
@@ -191,14 +180,17 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
    * @return array
    */
   static function &fields() {
-    if (!(self::$_fields)) {
-      self::$_fields = array(
+    if (!isset(Civi::$statics[__CLASS__]['fields'])) {
+      Civi::$statics[__CLASS__]['fields'] = array(
         'id' => array(
           'name' => 'id',
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch ID') ,
           'description' => 'Unique Address ID',
           'required' => true,
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
         ) ,
         'name' => array(
           'name' => 'name',
@@ -207,6 +199,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'description' => 'Variable name/programmatic handle for this batch.',
           'maxlength' => 64,
           'size' => CRM_Utils_Type::BIG,
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -218,6 +213,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'description' => 'Friendly Name.',
           'maxlength' => 64,
           'size' => CRM_Utils_Type::BIG,
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -229,6 +227,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'description' => 'Description of this batch set.',
           'rows' => 4,
           'cols' => 80,
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'TextArea',
           ) ,
@@ -238,6 +239,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch Created By') ,
           'description' => 'FK to Contact ID',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'FKClassName' => 'CRM_Contact_DAO_Contact',
         ) ,
         'created_date' => array(
@@ -245,6 +249,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
           'title' => ts('Batch Created Date') ,
           'description' => 'When was this item created',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Select Date',
           ) ,
@@ -254,6 +261,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch Modified By') ,
           'description' => 'FK to Contact ID',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'FKClassName' => 'CRM_Contact_DAO_Contact',
         ) ,
         'modified_date' => array(
@@ -261,12 +271,18 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
           'title' => ts('Batch Modified Date') ,
           'description' => 'When was this item created',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
         ) ,
         'saved_search_id' => array(
           'name' => 'saved_search_id',
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch Smart Group') ,
           'description' => 'FK to Saved Search ID',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
           'html' => array(
             'type' => 'EntityRef',
@@ -278,6 +294,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'title' => ts('Batch Status') ,
           'description' => 'fk to Batch Status options in civicrm_option_values',
           'required' => true,
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Select',
           ) ,
@@ -291,6 +310,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch Type') ,
           'description' => 'fk to Batch Type options in civicrm_option_values',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Select',
           ) ,
@@ -304,6 +326,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch Mode') ,
           'description' => 'fk to Batch mode options in civicrm_option_values',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Select',
           ) ,
@@ -321,6 +346,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
             20,
             2
           ) ,
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -330,6 +358,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch Number of Items') ,
           'description' => 'Number of items in a batch.',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Text',
           ) ,
@@ -339,6 +370,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Batch Payment Method') ,
           'description' => 'fk to Payment Instrument options in civicrm_option_values',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
           'html' => array(
             'type' => 'Select',
           ) ,
@@ -351,16 +385,23 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
           'name' => 'exported_date',
           'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
           'title' => ts('Batch Exported Date') ,
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
         ) ,
         'data' => array(
           'name' => 'data',
           'type' => CRM_Utils_Type::T_LONGTEXT,
           'title' => ts('Batch Data') ,
           'description' => 'cache entered data',
+          'table_name' => 'civicrm_batch',
+          'entity' => 'Batch',
+          'bao' => 'CRM_Batch_BAO_Batch',
         ) ,
       );
+      CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
     }
-    return self::$_fields;
+    return Civi::$statics[__CLASS__]['fields'];
   }
   /**
    * Return a mapping from field-name to the corresponding key (as used in fields()).