Merge pull request #9632 from yashodha/CRM-19795
[civicrm-core.git] / CRM / Contribute / DAO / Premium.php
index fd28e77e476461cf59bba7c2eb308357b35544ed..bc0208877fb345f062fdfb3806b249012bdb8c93 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.                                    |
 |                                                                    |
@@ -26,7 +26,7 @@
 */
 /**
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
  *
  * Generated from xml/schema/CRM/Contribute/Premium.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
@@ -41,18 +41,6 @@ class CRM_Contribute_DAO_Premium extends CRM_Core_DAO {
    * @var string
    */
   static $_tableName = 'civicrm_premiums';
-  /**
-   * 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
@@ -139,11 +127,12 @@ class CRM_Contribute_DAO_Premium extends CRM_Core_DAO {
    *   [CRM_Core_Reference_Interface]
    */
   static function getReferenceColumns() {
-    if (!self::$_links) {
-      self::$_links = static ::createReferenceColumns(__CLASS__);
-      self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
+    if (!isset(Civi::$statics[__CLASS__]['links'])) {
+      Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
+      Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
+      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
@@ -151,8 +140,8 @@ class CRM_Contribute_DAO_Premium 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,
@@ -233,8 +222,9 @@ class CRM_Contribute_DAO_Premium extends CRM_Core_DAO {
           'default' => '1',
         ) ,
       );
+      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()).