From 346aaabaeabb6d82550b18c5f7259b05f6cb19b1 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 28 Jul 2016 19:41:18 -0700 Subject: [PATCH] CRM-19130 - Regen DAOs with updated fields() and links() --- CRM/ACL/DAO/ACL.php | 28 ++++------- CRM/ACL/DAO/Cache.php | 30 ++++------- CRM/ACL/DAO/EntityRole.php | 28 ++++------- CRM/Activity/DAO/Activity.php | 36 +++++--------- CRM/Activity/DAO/ActivityContact.php | 30 ++++------- CRM/Batch/DAO/Batch.php | 32 +++++------- CRM/Batch/DAO/EntityBatch.php | 30 ++++------- CRM/Campaign/DAO/Campaign.php | 32 +++++------- CRM/Campaign/DAO/CampaignGroup.php | 30 ++++------- CRM/Campaign/DAO/Survey.php | 32 +++++------- CRM/Case/DAO/Case.php | 28 ++++------- CRM/Case/DAO/CaseActivity.php | 30 ++++------- CRM/Case/DAO/CaseContact.php | 30 ++++------- CRM/Case/DAO/CaseType.php | 19 ++----- CRM/Contact/DAO/ACLContactCache.php | 30 ++++------- CRM/Contact/DAO/Contact.php | 30 ++++------- CRM/Contact/DAO/ContactType.php | 28 ++++------- CRM/Contact/DAO/DashboardContact.php | 30 ++++------- CRM/Contact/DAO/Group.php | 32 +++++------- CRM/Contact/DAO/GroupContact.php | 34 +++++-------- CRM/Contact/DAO/GroupContactCache.php | 30 ++++------- CRM/Contact/DAO/GroupNesting.php | 30 ++++------- CRM/Contact/DAO/GroupOrganization.php | 30 ++++------- CRM/Contact/DAO/Relationship.php | 34 +++++-------- CRM/Contact/DAO/RelationshipType.php | 19 ++----- CRM/Contact/DAO/SavedSearch.php | 28 ++++------- CRM/Contact/DAO/SubscriptionHistory.php | 30 ++++------- CRM/Contribute/DAO/Contribution.php | 38 ++++++-------- CRM/Contribute/DAO/ContributionPage.php | 32 +++++------- CRM/Contribute/DAO/ContributionProduct.php | 30 ++++------- CRM/Contribute/DAO/ContributionRecur.php | 36 +++++--------- CRM/Contribute/DAO/ContributionSoft.php | 32 +++++------- CRM/Contribute/DAO/Premium.php | 28 ++++------- CRM/Contribute/DAO/PremiumsProduct.php | 32 +++++------- CRM/Contribute/DAO/Product.php | 28 ++++------- CRM/Contribute/DAO/Widget.php | 28 ++++------- CRM/Core/DAO/ActionLog.php | 32 +++++------- CRM/Core/DAO/ActionMapping.php | 19 ++----- CRM/Core/DAO/ActionSchedule.php | 34 +++++-------- CRM/Core/DAO/Address.php | 36 +++++--------- CRM/Core/DAO/AddressFormat.php | 19 ++----- CRM/Core/DAO/Cache.php | 28 ++++------- CRM/Core/DAO/Component.php | 19 ++----- CRM/Core/DAO/Country.php | 30 ++++------- CRM/Core/DAO/County.php | 28 ++++------- CRM/Core/DAO/CustomField.php | 28 ++++------- CRM/Core/DAO/CustomGroup.php | 28 ++++------- CRM/Core/DAO/Dashboard.php | 28 ++++------- CRM/Core/DAO/Discount.php | 30 ++++------- CRM/Core/DAO/Domain.php | 28 ++++------- CRM/Core/DAO/Email.php | 28 ++++------- CRM/Core/DAO/EntityFile.php | 30 ++++------- CRM/Core/DAO/EntityTag.php | 30 ++++------- CRM/Core/DAO/Extension.php | 19 ++----- CRM/Core/DAO/File.php | 19 ++----- CRM/Core/DAO/IM.php | 28 ++++------- CRM/Core/DAO/Job.php | 28 ++++------- CRM/Core/DAO/JobLog.php | 28 ++++------- CRM/Core/DAO/LocBlock.php | 42 ++++++---------- CRM/Core/DAO/LocationType.php | 19 ++----- CRM/Core/DAO/Log.php | 30 ++++------- CRM/Core/DAO/MailSettings.php | 28 ++++------- CRM/Core/DAO/Managed.php | 19 ++----- CRM/Core/DAO/Mapping.php | 19 ++----- CRM/Core/DAO/MappingField.php | 32 +++++------- CRM/Core/DAO/Menu.php | 30 ++++------- CRM/Core/DAO/MessageTemplate.php | 19 ++----- CRM/Core/DAO/Navigation.php | 30 ++++------- CRM/Core/DAO/Note.php | 30 ++++------- CRM/Core/DAO/OpenID.php | 28 ++++------- CRM/Core/DAO/OptionGroup.php | 19 ++----- CRM/Core/DAO/OptionValue.php | 32 +++++------- CRM/Core/DAO/Persistent.php | 19 ++----- CRM/Core/DAO/Phone.php | 28 ++++------- CRM/Core/DAO/PreferencesDate.php | 19 ++----- CRM/Core/DAO/PrevNextCache.php | 19 ++----- CRM/Core/DAO/PrintLabel.php | 28 ++++------- CRM/Core/DAO/RecurringEntity.php | 19 ++----- CRM/Core/DAO/Setting.php | 34 +++++-------- CRM/Core/DAO/StateProvince.php | 28 ++++------- CRM/Core/DAO/StatusPreference.php | 28 ++++------- CRM/Core/DAO/SystemLog.php | 19 ++----- CRM/Core/DAO/Tag.php | 30 ++++------- CRM/Core/DAO/Timezone.php | 28 ++++------- CRM/Core/DAO/UFField.php | 30 ++++------- CRM/Core/DAO/UFGroup.php | 32 +++++------- CRM/Core/DAO/UFJoin.php | 30 ++++------- CRM/Core/DAO/UFMatch.php | 30 ++++------- CRM/Core/DAO/Website.php | 28 ++++------- CRM/Core/DAO/WordReplacement.php | 28 ++++------- CRM/Core/DAO/Worldregion.php | 19 ++----- CRM/Cxn/DAO/Cxn.php | 19 ++----- CRM/Dedupe/DAO/Exception.php | 30 ++++------- CRM/Dedupe/DAO/Rule.php | 28 ++++------- CRM/Dedupe/DAO/RuleGroup.php | 19 ++----- CRM/Event/Cart/DAO/Cart.php | 28 ++++------- CRM/Event/Cart/DAO/EventInCart.php | 30 ++++------- CRM/Event/DAO/Event.php | 34 +++++-------- CRM/Event/DAO/Participant.php | 42 ++++++---------- CRM/Event/DAO/ParticipantPayment.php | 30 ++++------- CRM/Event/DAO/ParticipantStatusType.php | 19 ++----- CRM/Financial/DAO/Currency.php | 19 ++----- CRM/Financial/DAO/EntityFinancialAccount.php | 30 ++++------- CRM/Financial/DAO/EntityFinancialTrxn.php | 30 ++++------- CRM/Financial/DAO/FinancialAccount.php | 30 ++++------- CRM/Financial/DAO/FinancialItem.php | 32 +++++------- CRM/Financial/DAO/FinancialTrxn.php | 32 +++++------- CRM/Financial/DAO/FinancialType.php | 19 ++----- CRM/Financial/DAO/PaymentProcessor.php | 30 ++++------- CRM/Financial/DAO/PaymentProcessorType.php | 19 ++----- CRM/Financial/DAO/PaymentToken.php | 32 +++++------- CRM/Friend/DAO/Friend.php | 28 ++++------- CRM/Grant/DAO/Grant.php | 30 ++++------- CRM/Mailing/DAO/BouncePattern.php | 28 ++++------- CRM/Mailing/DAO/BounceType.php | 19 ++----- CRM/Mailing/DAO/Component.php | 19 ++----- CRM/Mailing/DAO/Mailing.php | 52 ++++++++------------ CRM/Mailing/DAO/MailingAB.php | 28 ++++------- CRM/Mailing/DAO/MailingGroup.php | 30 ++++------- CRM/Mailing/DAO/MailingJob.php | 30 ++++------- CRM/Mailing/DAO/Recipients.php | 34 +++++-------- CRM/Mailing/DAO/Spool.php | 28 ++++------- CRM/Mailing/DAO/TrackableURL.php | 28 ++++------- CRM/Mailing/Event/DAO/Bounce.php | 28 ++++------- CRM/Mailing/Event/DAO/Confirm.php | 28 ++++------- CRM/Mailing/Event/DAO/Delivered.php | 28 ++++------- CRM/Mailing/Event/DAO/Forward.php | 30 ++++------- CRM/Mailing/Event/DAO/Opened.php | 28 ++++------- CRM/Mailing/Event/DAO/Queue.php | 34 +++++-------- CRM/Mailing/Event/DAO/Reply.php | 28 ++++------- CRM/Mailing/Event/DAO/Subscribe.php | 30 ++++------- CRM/Mailing/Event/DAO/TrackableURLOpen.php | 30 ++++------- CRM/Mailing/Event/DAO/Unsubscribe.php | 28 ++++------- CRM/Member/DAO/Membership.php | 38 ++++++-------- CRM/Member/DAO/MembershipBlock.php | 30 ++++------- CRM/Member/DAO/MembershipLog.php | 34 +++++-------- CRM/Member/DAO/MembershipPayment.php | 30 ++++------- CRM/Member/DAO/MembershipStatus.php | 19 ++----- CRM/Member/DAO/MembershipType.php | 32 +++++------- CRM/PCP/DAO/PCP.php | 28 ++++------- CRM/PCP/DAO/PCPBlock.php | 32 +++++------- CRM/Pledge/DAO/Pledge.php | 34 +++++-------- CRM/Pledge/DAO/PledgeBlock.php | 28 ++++------- CRM/Pledge/DAO/PledgePayment.php | 30 ++++------- CRM/Price/DAO/LineItem.php | 36 +++++--------- CRM/Price/DAO/PriceField.php | 28 ++++------- CRM/Price/DAO/PriceFieldValue.php | 32 +++++------- CRM/Price/DAO/PriceSet.php | 30 ++++------- CRM/Price/DAO/PriceSetEntity.php | 30 ++++------- CRM/Queue/DAO/QueueItem.php | 19 ++----- CRM/Report/DAO/ReportInstance.php | 36 +++++--------- CRM/SMS/DAO/Provider.php | 19 ++----- 152 files changed, 1384 insertions(+), 2933 deletions(-) diff --git a/CRM/ACL/DAO/ACL.php b/CRM/ACL/DAO/ACL.php index 8b07f73630..e9ff994dcf 100644 --- a/CRM/ACL/DAO/ACL.php +++ b/CRM/ACL/DAO/ACL.php @@ -41,18 +41,6 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_acl'; - /** - * 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 @@ -142,11 +130,12 @@ class CRM_ACL_DAO_ACL 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 @@ -154,8 +143,8 @@ class CRM_ACL_DAO_ACL 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, @@ -252,8 +241,9 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/ACL/DAO/Cache.php b/CRM/ACL/DAO/Cache.php index 6aca3cbcd5..6e728c509f 100644 --- a/CRM/ACL/DAO/Cache.php +++ b/CRM/ACL/DAO/Cache.php @@ -41,18 +41,6 @@ class CRM_ACL_DAO_Cache extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_acl_cache'; - /** - * 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 @@ -100,12 +88,13 @@ class CRM_ACL_DAO_Cache 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'acl_id', 'civicrm_acl', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'acl_id', 'civicrm_acl', '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 @@ -113,8 +102,8 @@ class CRM_ACL_DAO_Cache 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, @@ -145,8 +134,9 @@ class CRM_ACL_DAO_Cache extends CRM_Core_DAO { 'required' => false, ) , ); + 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()). diff --git a/CRM/ACL/DAO/EntityRole.php b/CRM/ACL/DAO/EntityRole.php index 4e245eba04..af50453f9d 100644 --- a/CRM/ACL/DAO/EntityRole.php +++ b/CRM/ACL/DAO/EntityRole.php @@ -41,18 +41,6 @@ class CRM_ACL_DAO_EntityRole extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_acl_entity_role'; - /** - * 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 @@ -106,11 +94,12 @@ class CRM_ACL_DAO_EntityRole 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 @@ -118,8 +107,8 @@ class CRM_ACL_DAO_EntityRole 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, @@ -157,8 +146,9 @@ class CRM_ACL_DAO_EntityRole extends CRM_Core_DAO { 'description' => 'Is this property active?', ) , ); + 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()). diff --git a/CRM/Activity/DAO/Activity.php b/CRM/Activity/DAO/Activity.php index 2d5e0c232b..8dab080dc0 100644 --- a/CRM/Activity/DAO/Activity.php +++ b/CRM/Activity/DAO/Activity.php @@ -41,18 +41,6 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_activity'; - /** - * 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 @@ -215,15 +203,16 @@ class CRM_Activity_DAO_Activity 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_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_activity', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_id', 'civicrm_relationship', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'original_id', 'civicrm_activity', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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() , 'phone_id', 'civicrm_phone', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_activity', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_id', 'civicrm_relationship', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'original_id', 'civicrm_activity', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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 @@ -231,8 +220,8 @@ class CRM_Activity_DAO_Activity 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( 'activity_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -536,8 +525,9 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Activity/DAO/ActivityContact.php b/CRM/Activity/DAO/ActivityContact.php index f6a6d38576..da7305f527 100644 --- a/CRM/Activity/DAO/ActivityContact.php +++ b/CRM/Activity/DAO/ActivityContact.php @@ -41,18 +41,6 @@ class CRM_Activity_DAO_ActivityContact extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_activity_contact'; - /** - * 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 @@ -100,12 +88,13 @@ class CRM_Activity_DAO_ActivityContact 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_Basic(self::getTableName() , 'activity_id', 'civicrm_activity', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'activity_id', 'civicrm_activity', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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 @@ -113,8 +102,8 @@ class CRM_Activity_DAO_ActivityContact 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, @@ -157,8 +146,9 @@ class CRM_Activity_DAO_ActivityContact extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Batch/DAO/Batch.php b/CRM/Batch/DAO/Batch.php index ee02f29bc3..9f38f0a558 100644 --- a/CRM/Batch/DAO/Batch.php +++ b/CRM/Batch/DAO/Batch.php @@ -41,18 +41,6 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO { * @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 @@ -177,13 +165,14 @@ class CRM_Batch_DAO_Batch 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_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,8 +180,8 @@ 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, @@ -359,8 +348,9 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO { 'description' => 'cache entered data', ) , ); + 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()). diff --git a/CRM/Batch/DAO/EntityBatch.php b/CRM/Batch/DAO/EntityBatch.php index 50d790e876..78411ba710 100644 --- a/CRM/Batch/DAO/EntityBatch.php +++ b/CRM/Batch/DAO/EntityBatch.php @@ -41,18 +41,6 @@ class CRM_Batch_DAO_EntityBatch extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_entity_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 @@ -100,12 +88,13 @@ class CRM_Batch_DAO_EntityBatch 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_Basic(self::getTableName() , 'batch_id', 'civicrm_batch', 'id'); - 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_Basic(self::getTableName() , 'batch_id', 'civicrm_batch', 'id'); + 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 @@ -113,8 +102,8 @@ class CRM_Batch_DAO_EntityBatch 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, @@ -146,8 +135,9 @@ class CRM_Batch_DAO_EntityBatch extends CRM_Core_DAO { 'FKClassName' => 'CRM_Batch_DAO_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()). diff --git a/CRM/Campaign/DAO/Campaign.php b/CRM/Campaign/DAO/Campaign.php index 4da1996b36..254b0ae268 100644 --- a/CRM/Campaign/DAO/Campaign.php +++ b/CRM/Campaign/DAO/Campaign.php @@ -41,18 +41,6 @@ class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_campaign'; - /** - * 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 @@ -178,13 +166,14 @@ class CRM_Campaign_DAO_Campaign 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_Basic(self::getTableName() , 'parent_id', 'civicrm_campaign', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'last_modified_id', 'civicrm_contact', '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() , 'parent_id', 'civicrm_campaign', 'id'); + 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() , 'last_modified_id', 'civicrm_contact', '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 @@ -192,8 +181,8 @@ class CRM_Campaign_DAO_Campaign 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, @@ -410,8 +399,9 @@ class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Campaign/DAO/CampaignGroup.php b/CRM/Campaign/DAO/CampaignGroup.php index 99c9a00d52..a706bffa7f 100644 --- a/CRM/Campaign/DAO/CampaignGroup.php +++ b/CRM/Campaign/DAO/CampaignGroup.php @@ -41,18 +41,6 @@ class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_campaign_group'; - /** - * 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 @@ -106,12 +94,13 @@ class CRM_Campaign_DAO_CampaignGroup 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_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); - 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_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); + 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 @@ -119,8 +108,8 @@ class CRM_Campaign_DAO_CampaignGroup 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, @@ -173,8 +162,9 @@ class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO { 'default' => 'NULL', ) , ); + 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()). diff --git a/CRM/Campaign/DAO/Survey.php b/CRM/Campaign/DAO/Survey.php index 45b2281e2b..65c96852b5 100644 --- a/CRM/Campaign/DAO/Survey.php +++ b/CRM/Campaign/DAO/Survey.php @@ -41,18 +41,6 @@ class CRM_Campaign_DAO_Survey extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_survey'; - /** - * 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 @@ -196,13 +184,14 @@ class CRM_Campaign_DAO_Survey 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_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'last_modified_id', 'civicrm_contact', '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() , 'campaign_id', 'civicrm_campaign', 'id'); + 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() , 'last_modified_id', 'civicrm_contact', '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 @@ -210,8 +199,8 @@ class CRM_Campaign_DAO_Survey 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, @@ -387,8 +376,9 @@ class CRM_Campaign_DAO_Survey 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()). diff --git a/CRM/Case/DAO/Case.php b/CRM/Case/DAO/Case.php index 526965fc77..a1fa6e765b 100644 --- a/CRM/Case/DAO/Case.php +++ b/CRM/Case/DAO/Case.php @@ -41,18 +41,6 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_case'; - /** - * 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 @@ -123,11 +111,12 @@ class CRM_Case_DAO_Case 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_Basic(self::getTableName() , 'case_type_id', 'civicrm_case_type', '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() , 'case_type_id', 'civicrm_case_type', '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 @@ -135,8 +124,8 @@ class CRM_Case_DAO_Case 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( 'case_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -254,8 +243,9 @@ class CRM_Case_DAO_Case extends CRM_Core_DAO { 'export' => true, ) , ); + 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()). diff --git a/CRM/Case/DAO/CaseActivity.php b/CRM/Case/DAO/CaseActivity.php index 738e7ac7e2..78c5803da8 100644 --- a/CRM/Case/DAO/CaseActivity.php +++ b/CRM/Case/DAO/CaseActivity.php @@ -41,18 +41,6 @@ class CRM_Case_DAO_CaseActivity extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_case_activity'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Case_DAO_CaseActivity 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_Basic(self::getTableName() , 'case_id', 'civicrm_case', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'activity_id', 'civicrm_activity', '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() , 'case_id', 'civicrm_case', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'activity_id', 'civicrm_activity', '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 @@ -107,8 +96,8 @@ class CRM_Case_DAO_CaseActivity 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, @@ -133,8 +122,9 @@ class CRM_Case_DAO_CaseActivity extends CRM_Core_DAO { 'FKClassName' => 'CRM_Activity_DAO_Activity', ) , ); + 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()). diff --git a/CRM/Case/DAO/CaseContact.php b/CRM/Case/DAO/CaseContact.php index 8143ed8ff8..ff1ef5f5e2 100644 --- a/CRM/Case/DAO/CaseContact.php +++ b/CRM/Case/DAO/CaseContact.php @@ -41,18 +41,6 @@ class CRM_Case_DAO_CaseContact extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_case_contact'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Case_DAO_CaseContact 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_Basic(self::getTableName() , 'case_id', 'civicrm_case', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'case_id', 'civicrm_case', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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 @@ -107,8 +96,8 @@ class CRM_Case_DAO_CaseContact 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, @@ -136,8 +125,9 @@ class CRM_Case_DAO_CaseContact extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Case/DAO/CaseType.php b/CRM/Case/DAO/CaseType.php index 4c34b5a39a..6ae4cf7d13 100644 --- a/CRM/Case/DAO/CaseType.php +++ b/CRM/Case/DAO/CaseType.php @@ -41,18 +41,6 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_case_type'; - /** - * 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 @@ -123,8 +111,8 @@ class CRM_Case_DAO_CaseType 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, @@ -185,8 +173,9 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO { 'description' => 'xml definition of case type', ) , ); + 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()). diff --git a/CRM/Contact/DAO/ACLContactCache.php b/CRM/Contact/DAO/ACLContactCache.php index 015b8fcc3e..5dda7d826f 100644 --- a/CRM/Contact/DAO/ACLContactCache.php +++ b/CRM/Contact/DAO/ACLContactCache.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_ACLContactCache extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_acl_contact_cache'; - /** - * 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 @@ -100,12 +88,13 @@ class CRM_Contact_DAO_ACLContactCache 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_Basic(self::getTableName() , 'user_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'user_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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 @@ -113,8 +102,8 @@ class CRM_Contact_DAO_ACLContactCache 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, @@ -153,8 +142,9 @@ class CRM_Contact_DAO_ACLContactCache extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Contact/DAO/Contact.php b/CRM/Contact/DAO/Contact.php index 8c7e8a5600..b82bc37330 100644 --- a/CRM/Contact/DAO/Contact.php +++ b/CRM/Contact/DAO/Contact.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contact'; - /** - * 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 @@ -381,12 +369,13 @@ class CRM_Contact_DAO_Contact 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_Basic(self::getTableName() , 'primary_contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'employer_id', 'civicrm_contact', '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() , 'primary_contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'employer_id', 'civicrm_contact', '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 @@ -394,8 +383,8 @@ class CRM_Contact_DAO_Contact 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, @@ -1158,8 +1147,9 @@ class CRM_Contact_DAO_Contact extends CRM_Core_DAO { 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', ) , ); + 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()). diff --git a/CRM/Contact/DAO/ContactType.php b/CRM/Contact/DAO/ContactType.php index b7d008d3f9..ac5fb9024a 100644 --- a/CRM/Contact/DAO/ContactType.php +++ b/CRM/Contact/DAO/ContactType.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_ContactType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contact_type'; - /** - * 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 @@ -124,11 +112,12 @@ class CRM_Contact_DAO_ContactType 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_Basic(self::getTableName() , 'parent_id', 'civicrm_contact_type', '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() , 'parent_id', 'civicrm_contact_type', '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 @@ -136,8 +125,8 @@ class CRM_Contact_DAO_ContactType 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, @@ -206,8 +195,9 @@ class CRM_Contact_DAO_ContactType extends CRM_Core_DAO { 'description' => 'Is this contact type a predefined system type', ) , ); + 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()). diff --git a/CRM/Contact/DAO/DashboardContact.php b/CRM/Contact/DAO/DashboardContact.php index 4e780cdefe..31a9899daa 100644 --- a/CRM/Contact/DAO/DashboardContact.php +++ b/CRM/Contact/DAO/DashboardContact.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_DashboardContact extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_dashboard_contact'; - /** - * 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 @@ -135,12 +123,13 @@ class CRM_Contact_DAO_DashboardContact 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_Basic(self::getTableName() , 'dashboard_id', 'civicrm_dashboard', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'dashboard_id', 'civicrm_dashboard', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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 @@ -148,8 +137,8 @@ class CRM_Contact_DAO_DashboardContact 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, @@ -216,8 +205,9 @@ class CRM_Contact_DAO_DashboardContact extends CRM_Core_DAO { 'description' => 'When was content populated', ) , ); + 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()). diff --git a/CRM/Contact/DAO/Group.php b/CRM/Contact/DAO/Group.php index bc9444453c..2dd24c632e 100644 --- a/CRM/Contact/DAO/Group.php +++ b/CRM/Contact/DAO/Group.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_Group extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_group'; - /** - * 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 @@ -195,13 +183,14 @@ class CRM_Contact_DAO_Group 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_Basic(self::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id'); - 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'); + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id'); + 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'); + 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 @@ -209,8 +198,8 @@ class CRM_Contact_DAO_Group 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, @@ -363,8 +352,9 @@ class CRM_Contact_DAO_Group extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); + 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()). diff --git a/CRM/Contact/DAO/GroupContact.php b/CRM/Contact/DAO/GroupContact.php index 87c3e48bc7..964b8e737f 100644 --- a/CRM/Contact/DAO/GroupContact.php +++ b/CRM/Contact/DAO/GroupContact.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_GroupContact extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_group_contact'; - /** - * 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 @@ -112,14 +100,15 @@ class CRM_Contact_DAO_GroupContact 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_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_id', 'civicrm_loc_block', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', '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() , 'group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_id', 'civicrm_loc_block', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', '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 @@ -127,8 +116,8 @@ class CRM_Contact_DAO_GroupContact 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, @@ -189,8 +178,9 @@ class CRM_Contact_DAO_GroupContact extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_Email', ) , ); + 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()). diff --git a/CRM/Contact/DAO/GroupContactCache.php b/CRM/Contact/DAO/GroupContactCache.php index 6924273f57..87a88a4fe2 100644 --- a/CRM/Contact/DAO/GroupContactCache.php +++ b/CRM/Contact/DAO/GroupContactCache.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_GroupContactCache extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_group_contact_cache'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Contact_DAO_GroupContactCache 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_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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 @@ -107,8 +96,8 @@ class CRM_Contact_DAO_GroupContactCache 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, @@ -141,8 +130,9 @@ class CRM_Contact_DAO_GroupContactCache extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); + 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()). diff --git a/CRM/Contact/DAO/GroupNesting.php b/CRM/Contact/DAO/GroupNesting.php index 79a3b87232..f1dca5b1a6 100644 --- a/CRM/Contact/DAO/GroupNesting.php +++ b/CRM/Contact/DAO/GroupNesting.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_GroupNesting extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_group_nesting'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Contact_DAO_GroupNesting 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_Basic(self::getTableName() , 'child_group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_group_id', 'civicrm_group', '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() , 'child_group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_group_id', 'civicrm_group', '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 @@ -107,8 +96,8 @@ class CRM_Contact_DAO_GroupNesting 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, @@ -133,8 +122,9 @@ class CRM_Contact_DAO_GroupNesting extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Group', ) , ); + 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()). diff --git a/CRM/Contact/DAO/GroupOrganization.php b/CRM/Contact/DAO/GroupOrganization.php index 93ba27fc24..6de29b76c8 100644 --- a/CRM/Contact/DAO/GroupOrganization.php +++ b/CRM/Contact/DAO/GroupOrganization.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_GroupOrganization extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_group_organization'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Contact_DAO_GroupOrganization 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_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'organization_id', 'civicrm_contact', '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() , 'group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'organization_id', 'civicrm_contact', '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 @@ -107,8 +96,8 @@ class CRM_Contact_DAO_GroupOrganization 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, @@ -141,8 +130,9 @@ class CRM_Contact_DAO_GroupOrganization extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); + 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()). diff --git a/CRM/Contact/DAO/Relationship.php b/CRM/Contact/DAO/Relationship.php index b6ded4a951..c8a926576b 100644 --- a/CRM/Contact/DAO/Relationship.php +++ b/CRM/Contact/DAO/Relationship.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_Relationship extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_relationship'; - /** - * 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 @@ -144,14 +132,15 @@ class CRM_Contact_DAO_Relationship 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_Basic(self::getTableName() , 'contact_id_a', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id_b', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_type_id', 'civicrm_relationship_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'case_id', 'civicrm_case', '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() , 'contact_id_a', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id_b', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_type_id', 'civicrm_relationship_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'case_id', 'civicrm_case', '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 @@ -159,8 +148,8 @@ class CRM_Contact_DAO_Relationship 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, @@ -268,8 +257,9 @@ class CRM_Contact_DAO_Relationship extends CRM_Core_DAO { 'FKClassName' => 'CRM_Case_DAO_Case', ) , ); + 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()). diff --git a/CRM/Contact/DAO/RelationshipType.php b/CRM/Contact/DAO/RelationshipType.php index e2c020657a..3e72e48b5f 100644 --- a/CRM/Contact/DAO/RelationshipType.php +++ b/CRM/Contact/DAO/RelationshipType.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_RelationshipType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_relationship_type'; - /** - * 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 @@ -147,8 +135,8 @@ class CRM_Contact_DAO_RelationshipType 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, @@ -281,8 +269,9 @@ class CRM_Contact_DAO_RelationshipType 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()). diff --git a/CRM/Contact/DAO/SavedSearch.php b/CRM/Contact/DAO/SavedSearch.php index f605edbbba..58abf71a95 100644 --- a/CRM/Contact/DAO/SavedSearch.php +++ b/CRM/Contact/DAO/SavedSearch.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_saved_search'; - /** - * 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 @@ -118,11 +106,12 @@ class CRM_Contact_DAO_SavedSearch 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_Basic(self::getTableName() , 'mapping_id', 'civicrm_mapping', '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() , 'mapping_id', 'civicrm_mapping', '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 @@ -130,8 +119,8 @@ class CRM_Contact_DAO_SavedSearch 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, @@ -182,8 +171,9 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { 'description' => 'the tables to be included in the count statement', ) , ); + 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()). diff --git a/CRM/Contact/DAO/SubscriptionHistory.php b/CRM/Contact/DAO/SubscriptionHistory.php index b21fed5a4e..5559618bce 100644 --- a/CRM/Contact/DAO/SubscriptionHistory.php +++ b/CRM/Contact/DAO/SubscriptionHistory.php @@ -41,18 +41,6 @@ class CRM_Contact_DAO_SubscriptionHistory extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_subscription_history'; - /** - * 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 @@ -118,12 +106,13 @@ class CRM_Contact_DAO_SubscriptionHistory 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'group_id', 'civicrm_group', '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 @@ -131,8 +120,8 @@ class CRM_Contact_DAO_SubscriptionHistory 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, @@ -204,8 +193,9 @@ class CRM_Contact_DAO_SubscriptionHistory extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Contribute/DAO/Contribution.php b/CRM/Contribute/DAO/Contribution.php index 7c7180153a..1417839cf8 100644 --- a/CRM/Contribute/DAO/Contribution.php +++ b/CRM/Contribute/DAO/Contribution.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contribution'; - /** - * 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 @@ -244,16 +232,17 @@ class CRM_Contribute_DAO_Contribution 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_recur_id', 'civicrm_contribution_recur', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'address_id', 'civicrm_address', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_recur_id', 'civicrm_contribution_recur', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'address_id', 'civicrm_address', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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 @@ -261,8 +250,8 @@ class CRM_Contribute_DAO_Contribution 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( 'contribution_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -711,8 +700,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Contribute/DAO/ContributionPage.php b/CRM/Contribute/DAO/ContributionPage.php index 91caac058d..5bc1178b5d 100644 --- a/CRM/Contribute/DAO/ContributionPage.php +++ b/CRM/Contribute/DAO/ContributionPage.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contribution_page'; - /** - * 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 @@ -346,13 +334,14 @@ class CRM_Contribute_DAO_ContributionPage 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_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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() , 'financial_type_id', 'civicrm_financial_type', 'id'); + 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() , 'campaign_id', 'civicrm_campaign', '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 @@ -360,8 +349,8 @@ class CRM_Contribute_DAO_ContributionPage 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, @@ -733,8 +722,9 @@ class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO { 'description' => 'if true - billing block is required for online contribution page', ) , ); + 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()). diff --git a/CRM/Contribute/DAO/ContributionProduct.php b/CRM/Contribute/DAO/ContributionProduct.php index b22c8d84e0..ffd4a07134 100644 --- a/CRM/Contribute/DAO/ContributionProduct.php +++ b/CRM/Contribute/DAO/ContributionProduct.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_ContributionProduct extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contribution_product'; - /** - * 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 @@ -131,12 +119,13 @@ class CRM_Contribute_DAO_ContributionProduct 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_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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() , 'contribution_id', 'civicrm_contribution', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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 @@ -144,8 +133,8 @@ class CRM_Contribute_DAO_ContributionProduct 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, @@ -235,8 +224,9 @@ class CRM_Contribute_DAO_ContributionProduct extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Contribute/DAO/ContributionRecur.php b/CRM/Contribute/DAO/ContributionRecur.php index 3b5d13adbe..cf690539d7 100644 --- a/CRM/Contribute/DAO/ContributionRecur.php +++ b/CRM/Contribute/DAO/ContributionRecur.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contribution_recur'; - /** - * 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 @@ -242,15 +230,16 @@ class CRM_Contribute_DAO_ContributionRecur 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_token_id', 'civicrm_payment_token', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_token_id', 'civicrm_payment_token', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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 @@ -258,8 +247,8 @@ class CRM_Contribute_DAO_ContributionRecur 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, @@ -561,8 +550,9 @@ class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Contribute/DAO/ContributionSoft.php b/CRM/Contribute/DAO/ContributionSoft.php index bef532262f..02d4c47f59 100644 --- a/CRM/Contribute/DAO/ContributionSoft.php +++ b/CRM/Contribute/DAO/ContributionSoft.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_ContributionSoft extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contribution_soft'; - /** - * 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 @@ -133,13 +121,14 @@ class CRM_Contribute_DAO_ContributionSoft 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_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'pcp_id', 'civicrm_pcp', '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() , 'contribution_id', 'civicrm_contribution', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'pcp_id', 'civicrm_pcp', '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 @@ -147,8 +136,8 @@ class CRM_Contribute_DAO_ContributionSoft 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( 'contribution_soft_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -262,8 +251,9 @@ class CRM_Contribute_DAO_ContributionSoft extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Contribute/DAO/Premium.php b/CRM/Contribute/DAO/Premium.php index fd28e77e47..76db38743d 100644 --- a/CRM/Contribute/DAO/Premium.php +++ b/CRM/Contribute/DAO/Premium.php @@ -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()). diff --git a/CRM/Contribute/DAO/PremiumsProduct.php b/CRM/Contribute/DAO/PremiumsProduct.php index 7bbae64b83..4dd16782a1 100644 --- a/CRM/Contribute/DAO/PremiumsProduct.php +++ b/CRM/Contribute/DAO/PremiumsProduct.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_PremiumsProduct extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_premiums_product'; - /** - * 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 @@ -105,13 +93,14 @@ class CRM_Contribute_DAO_PremiumsProduct 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_Basic(self::getTableName() , 'premiums_id', 'civicrm_premiums', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'product_id', 'civicrm_product', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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() , 'premiums_id', 'civicrm_premiums', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'product_id', 'civicrm_product', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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 @@ -119,8 +108,8 @@ class CRM_Contribute_DAO_PremiumsProduct 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, @@ -164,8 +153,9 @@ class CRM_Contribute_DAO_PremiumsProduct extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Contribute/DAO/Product.php b/CRM/Contribute/DAO/Product.php index ad79ad1d27..8701532f37 100644 --- a/CRM/Contribute/DAO/Product.php +++ b/CRM/Contribute/DAO/Product.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_Product extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_product'; - /** - * 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 @@ -189,11 +177,12 @@ class CRM_Contribute_DAO_Product 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_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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() , 'financial_type_id', 'civicrm_financial_type', '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 @@ -201,8 +190,8 @@ class CRM_Contribute_DAO_Product 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, @@ -395,8 +384,9 @@ class CRM_Contribute_DAO_Product extends CRM_Core_DAO { 'description' => 'Number of units for delivery frequency of subscription, service, membership (e.g. every 3 Months).', ) , ); + 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()). diff --git a/CRM/Contribute/DAO/Widget.php b/CRM/Contribute/DAO/Widget.php index 4d533ef440..4fb38b170f 100644 --- a/CRM/Contribute/DAO/Widget.php +++ b/CRM/Contribute/DAO/Widget.php @@ -41,18 +41,6 @@ class CRM_Contribute_DAO_Widget extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_contribution_widget'; - /** - * 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 @@ -169,11 +157,12 @@ class CRM_Contribute_DAO_Widget 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_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', '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() , 'contribution_page_id', 'civicrm_contribution_page', '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 @@ -181,8 +170,8 @@ class CRM_Contribute_DAO_Widget 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, @@ -305,8 +294,9 @@ class CRM_Contribute_DAO_Widget extends CRM_Core_DAO { 'size' => CRM_Utils_Type::TWELVE, ) , ); + 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()). diff --git a/CRM/Core/DAO/ActionLog.php b/CRM/Core/DAO/ActionLog.php index a5746f69fa..e9332bde1b 100644 --- a/CRM/Core/DAO/ActionLog.php +++ b/CRM/Core/DAO/ActionLog.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_ActionLog extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_action_log'; - /** - * 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 @@ -135,13 +123,14 @@ class CRM_Core_DAO_ActionLog 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'action_schedule_id', 'civicrm_action_schedule', 'id'); - 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'action_schedule_id', 'civicrm_action_schedule', 'id'); + 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 @@ -149,8 +138,8 @@ class CRM_Core_DAO_ActionLog 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, @@ -219,8 +208,9 @@ class CRM_Core_DAO_ActionLog extends CRM_Core_DAO { 'default' => 'NULL', ) , ); + 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()). diff --git a/CRM/Core/DAO/ActionMapping.php b/CRM/Core/DAO/ActionMapping.php index 46959a322e..f4c44bdb45 100644 --- a/CRM/Core/DAO/ActionMapping.php +++ b/CRM/Core/DAO/ActionMapping.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_ActionMapping extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_action_mapping'; - /** - * 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 @@ -128,8 +116,8 @@ class CRM_Core_DAO_ActionMapping 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, @@ -201,8 +189,9 @@ class CRM_Core_DAO_ActionMapping extends CRM_Core_DAO { 'size' => CRM_Utils_Type::BIG, ) , ); + 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()). diff --git a/CRM/Core/DAO/ActionSchedule.php b/CRM/Core/DAO/ActionSchedule.php index 53d56904bc..b3cb1d46c5 100644 --- a/CRM/Core/DAO/ActionSchedule.php +++ b/CRM/Core/DAO/ActionSchedule.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_action_schedule'; - /** - * 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 @@ -301,14 +289,15 @@ class CRM_Core_DAO_ActionSchedule 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_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'msg_template_id', 'civicrm_msg_template', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_template_id', 'civicrm_msg_template', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_provider_id', 'civicrm_sms_provider', '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() , 'group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'msg_template_id', 'civicrm_msg_template', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_template_id', 'civicrm_msg_template', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_provider_id', 'civicrm_sms_provider', '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 @@ -316,8 +305,8 @@ class CRM_Core_DAO_ActionSchedule 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, @@ -632,8 +621,9 @@ class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO { 'size' => CRM_Utils_Type::EIGHT, ) , ); + 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()). diff --git a/CRM/Core/DAO/Address.php b/CRM/Core/DAO/Address.php index 538564936c..8ac0062c8d 100644 --- a/CRM/Core/DAO/Address.php +++ b/CRM/Core/DAO/Address.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Address extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_address'; - /** - * 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 @@ -251,15 +239,16 @@ class CRM_Core_DAO_Address 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'county_id', 'civicrm_county', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'state_province_id', 'civicrm_state_province', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'country_id', 'civicrm_country', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'master_id', 'civicrm_address', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'county_id', 'civicrm_county', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'state_province_id', 'civicrm_state_province', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'country_id', 'civicrm_country', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'master_id', 'civicrm_address', '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 @@ -267,8 +256,8 @@ class CRM_Core_DAO_Address 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, @@ -647,8 +636,9 @@ class CRM_Core_DAO_Address extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_Address', ) , ); + 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()). diff --git a/CRM/Core/DAO/AddressFormat.php b/CRM/Core/DAO/AddressFormat.php index 4da6c20e0a..3e31107d9e 100644 --- a/CRM/Core/DAO/AddressFormat.php +++ b/CRM/Core/DAO/AddressFormat.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_AddressFormat extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_address_format'; - /** - * 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 @@ -87,8 +75,8 @@ class CRM_Core_DAO_AddressFormat 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, @@ -103,8 +91,9 @@ class CRM_Core_DAO_AddressFormat extends CRM_Core_DAO { 'description' => 'The format of an address', ) , ); + 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()). diff --git a/CRM/Core/DAO/Cache.php b/CRM/Core/DAO/Cache.php index 946969d3f0..c8392410a0 100644 --- a/CRM/Core/DAO/Cache.php +++ b/CRM/Core/DAO/Cache.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Cache extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_cache'; - /** - * 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 @@ -117,11 +105,12 @@ class CRM_Core_DAO_Cache 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_Basic(self::getTableName() , 'component_id', 'civicrm_component', '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() , 'component_id', 'civicrm_component', '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 @@ -129,8 +118,8 @@ class CRM_Core_DAO_Cache 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, @@ -186,8 +175,9 @@ class CRM_Core_DAO_Cache extends CRM_Core_DAO { 'description' => 'When should the cache item expire', ) , ); + 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()). diff --git a/CRM/Core/DAO/Component.php b/CRM/Core/DAO/Component.php index 93d18fa899..f020938c8a 100644 --- a/CRM/Core/DAO/Component.php +++ b/CRM/Core/DAO/Component.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Component extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_component'; - /** - * 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 @@ -94,8 +82,8 @@ class CRM_Core_DAO_Component 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, @@ -122,8 +110,9 @@ class CRM_Core_DAO_Component extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Core/DAO/Country.php b/CRM/Core/DAO/Country.php index c8a9dd74d6..6c84e4eec0 100644 --- a/CRM/Core/DAO/Country.php +++ b/CRM/Core/DAO/Country.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Country extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_country'; - /** - * 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 @@ -130,12 +118,13 @@ class CRM_Core_DAO_Country 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_Basic(self::getTableName() , 'address_format_id', 'civicrm_address_format', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'region_id', 'civicrm_worldregion', '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() , 'address_format_id', 'civicrm_address_format', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'region_id', 'civicrm_worldregion', '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 @@ -143,8 +132,8 @@ class CRM_Core_DAO_Country 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, @@ -219,8 +208,9 @@ class CRM_Core_DAO_Country extends CRM_Core_DAO { 'description' => 'Should state/province be displayed as abbreviation for contacts from this country?', ) , ); + 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()). diff --git a/CRM/Core/DAO/County.php b/CRM/Core/DAO/County.php index 720da3e04a..780ca69d4f 100644 --- a/CRM/Core/DAO/County.php +++ b/CRM/Core/DAO/County.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_County extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_county'; - /** - * 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 @@ -100,11 +88,12 @@ class CRM_Core_DAO_County 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_Basic(self::getTableName() , 'state_province_id', 'civicrm_state_province', '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() , 'state_province_id', 'civicrm_state_province', '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 @@ -112,8 +101,8 @@ class CRM_Core_DAO_County 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, @@ -151,8 +140,9 @@ class CRM_Core_DAO_County extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_StateProvince', ) , ); + 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()). diff --git a/CRM/Core/DAO/CustomField.php b/CRM/Core/DAO/CustomField.php index 23a0c47ec6..1604173b53 100644 --- a/CRM/Core/DAO/CustomField.php +++ b/CRM/Core/DAO/CustomField.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_custom_field'; - /** - * 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 @@ -256,11 +244,12 @@ class CRM_Core_DAO_CustomField 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_Basic(self::getTableName() , 'custom_group_id', 'civicrm_custom_group', '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() , 'custom_group_id', 'civicrm_custom_group', '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 @@ -268,8 +257,8 @@ class CRM_Core_DAO_CustomField 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, @@ -498,8 +487,9 @@ class CRM_Core_DAO_CustomField extends CRM_Core_DAO { 'description' => 'Should the multi-record custom field values be displayed in tab table listing', ) , ); + 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()). diff --git a/CRM/Core/DAO/CustomGroup.php b/CRM/Core/DAO/CustomGroup.php index 085061e0c5..854f0482e1 100644 --- a/CRM/Core/DAO/CustomGroup.php +++ b/CRM/Core/DAO/CustomGroup.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_custom_group'; - /** - * 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 @@ -196,11 +184,12 @@ class CRM_Core_DAO_CustomGroup 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_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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'); + 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 @@ -208,8 +197,8 @@ class CRM_Core_DAO_CustomGroup 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, @@ -366,8 +355,9 @@ class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO { 'description' => 'Is this a reserved Custom Group?', ) , ); + 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()). diff --git a/CRM/Core/DAO/Dashboard.php b/CRM/Core/DAO/Dashboard.php index b4f4bf0fab..218fb37aa2 100644 --- a/CRM/Core/DAO/Dashboard.php +++ b/CRM/Core/DAO/Dashboard.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Dashboard extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_dashboard'; - /** - * 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 @@ -159,11 +147,12 @@ class CRM_Core_DAO_Dashboard 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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() , 'domain_id', 'civicrm_domain', '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 @@ -171,8 +160,8 @@ class CRM_Core_DAO_Dashboard 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, @@ -278,8 +267,9 @@ class CRM_Core_DAO_Dashboard extends CRM_Core_DAO { 'description' => 'Ordering of the dashlets.', ) , ); + 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()). diff --git a/CRM/Core/DAO/Discount.php b/CRM/Core/DAO/Discount.php index 2e7da7c96b..0974dc4fdb 100644 --- a/CRM/Core/DAO/Discount.php +++ b/CRM/Core/DAO/Discount.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Discount extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_discount'; - /** - * 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 @@ -112,12 +100,13 @@ class CRM_Core_DAO_Discount 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_Basic(self::getTableName() , 'price_set_id', 'civicrm_price_set', 'id'); - 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_Basic(self::getTableName() , 'price_set_id', 'civicrm_price_set', 'id'); + 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 @@ -125,8 +114,8 @@ class CRM_Core_DAO_Discount 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, @@ -174,8 +163,9 @@ class CRM_Core_DAO_Discount extends CRM_Core_DAO { 'description' => 'Date when discount ends.', ) , ); + 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()). diff --git a/CRM/Core/DAO/Domain.php b/CRM/Core/DAO/Domain.php index db7bd223ae..8364ed4a72 100644 --- a/CRM/Core/DAO/Domain.php +++ b/CRM/Core/DAO/Domain.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Domain extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_domain'; - /** - * 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 @@ -124,11 +112,12 @@ class CRM_Core_DAO_Domain 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', '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 @@ -136,8 +125,8 @@ class CRM_Core_DAO_Domain 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, @@ -211,8 +200,9 @@ class CRM_Core_DAO_Domain extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Core/DAO/Email.php b/CRM/Core/DAO/Email.php index dc4022a16b..9af5d0f9ac 100644 --- a/CRM/Core/DAO/Email.php +++ b/CRM/Core/DAO/Email.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Email extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_email'; - /** - * 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 @@ -148,11 +136,12 @@ class CRM_Core_DAO_Email 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', '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 @@ -160,8 +149,8 @@ class CRM_Core_DAO_Email 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, @@ -281,8 +270,9 @@ class CRM_Core_DAO_Email extends CRM_Core_DAO { 'default' => 'NULL', ) , ); + 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()). diff --git a/CRM/Core/DAO/EntityFile.php b/CRM/Core/DAO/EntityFile.php index f363556322..6fbce79776 100644 --- a/CRM/Core/DAO/EntityFile.php +++ b/CRM/Core/DAO/EntityFile.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_EntityFile extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_entity_file'; - /** - * 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 @@ -100,12 +88,13 @@ class CRM_Core_DAO_EntityFile 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_Basic(self::getTableName() , 'file_id', 'civicrm_file', 'id'); - 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_Basic(self::getTableName() , 'file_id', 'civicrm_file', 'id'); + 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 @@ -113,8 +102,8 @@ class CRM_Core_DAO_EntityFile 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, @@ -146,8 +135,9 @@ class CRM_Core_DAO_EntityFile extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_File', ) , ); + 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()). diff --git a/CRM/Core/DAO/EntityTag.php b/CRM/Core/DAO/EntityTag.php index b3fcd469ee..2a85ea6e58 100644 --- a/CRM/Core/DAO/EntityTag.php +++ b/CRM/Core/DAO/EntityTag.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_EntityTag extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_entity_tag'; - /** - * 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 @@ -100,12 +88,13 @@ class CRM_Core_DAO_EntityTag 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_Basic(self::getTableName() , 'tag_id', 'civicrm_tag', 'id'); - 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_Basic(self::getTableName() , 'tag_id', 'civicrm_tag', 'id'); + 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 @@ -113,8 +102,8 @@ class CRM_Core_DAO_EntityTag 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, @@ -158,8 +147,9 @@ class CRM_Core_DAO_EntityTag extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/Extension.php b/CRM/Core/DAO/Extension.php index 4eed598db3..ee1118f679 100644 --- a/CRM/Core/DAO/Extension.php +++ b/CRM/Core/DAO/Extension.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Extension extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_extension'; - /** - * 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 @@ -122,8 +110,8 @@ class CRM_Core_DAO_Extension 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, @@ -214,8 +202,9 @@ class CRM_Core_DAO_Extension 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()). diff --git a/CRM/Core/DAO/File.php b/CRM/Core/DAO/File.php index 037ec99e9e..9d53a55caf 100644 --- a/CRM/Core/DAO/File.php +++ b/CRM/Core/DAO/File.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_File extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_file'; - /** - * 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 @@ -117,8 +105,8 @@ class CRM_Core_DAO_File 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, @@ -169,8 +157,9 @@ class CRM_Core_DAO_File extends CRM_Core_DAO { 'description' => 'Date and time that this attachment was uploaded or written to server.', ) , ); + 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()). diff --git a/CRM/Core/DAO/IM.php b/CRM/Core/DAO/IM.php index 9279c6b62d..af794d6a2f 100644 --- a/CRM/Core/DAO/IM.php +++ b/CRM/Core/DAO/IM.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_IM extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_im'; - /** - * 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 @@ -118,11 +106,12 @@ class CRM_Core_DAO_IM 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', '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 @@ -130,8 +119,8 @@ class CRM_Core_DAO_IM 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, @@ -202,8 +191,9 @@ class CRM_Core_DAO_IM extends CRM_Core_DAO { 'description' => 'Is this the billing?', ) , ); + 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()). diff --git a/CRM/Core/DAO/Job.php b/CRM/Core/DAO/Job.php index 6cf43c1af6..411f6733e2 100644 --- a/CRM/Core/DAO/Job.php +++ b/CRM/Core/DAO/Job.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Job extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_job'; - /** - * 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 @@ -142,11 +130,12 @@ class CRM_Core_DAO_Job 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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() , 'domain_id', 'civicrm_domain', '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 @@ -154,8 +143,8 @@ class CRM_Core_DAO_Job 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, @@ -256,8 +245,9 @@ class CRM_Core_DAO_Job extends CRM_Core_DAO { 'description' => 'Is this job active?', ) , ); + 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()). diff --git a/CRM/Core/DAO/JobLog.php b/CRM/Core/DAO/JobLog.php index 8dcdec19a5..e8a5bfde98 100644 --- a/CRM/Core/DAO/JobLog.php +++ b/CRM/Core/DAO/JobLog.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_JobLog extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_job_log'; - /** - * 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 @@ -124,11 +112,12 @@ class CRM_Core_DAO_JobLog 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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() , 'domain_id', 'civicrm_domain', '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 @@ -136,8 +125,8 @@ class CRM_Core_DAO_JobLog 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, @@ -201,8 +190,9 @@ class CRM_Core_DAO_JobLog extends CRM_Core_DAO { 'description' => 'Potential extended data for specific job run (e.g. tracebacks).', ) , ); + 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()). diff --git a/CRM/Core/DAO/LocBlock.php b/CRM/Core/DAO/LocBlock.php index f3800a8abd..41e8b7b823 100644 --- a/CRM/Core/DAO/LocBlock.php +++ b/CRM/Core/DAO/LocBlock.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_LocBlock extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_loc_block'; - /** - * 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 @@ -122,18 +110,19 @@ class CRM_Core_DAO_LocBlock 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_Basic(self::getTableName() , 'address_id', 'civicrm_address', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'im_id', 'civicrm_im', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'address_2_id', 'civicrm_address', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_2_id', 'civicrm_email', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_2_id', 'civicrm_phone', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'im_2_id', 'civicrm_im', '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() , 'address_id', 'civicrm_address', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'im_id', 'civicrm_im', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'address_2_id', 'civicrm_address', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_2_id', 'civicrm_email', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_2_id', 'civicrm_phone', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'im_2_id', 'civicrm_im', '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 @@ -141,8 +130,8 @@ class CRM_Core_DAO_LocBlock 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, @@ -199,8 +188,9 @@ class CRM_Core_DAO_LocBlock extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_IM', ) , ); + 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()). diff --git a/CRM/Core/DAO/LocationType.php b/CRM/Core/DAO/LocationType.php index 5d280769f0..bf64d5ae13 100644 --- a/CRM/Core/DAO/LocationType.php +++ b/CRM/Core/DAO/LocationType.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_LocationType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_location_type'; - /** - * 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 @@ -123,8 +111,8 @@ class CRM_Core_DAO_LocationType 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, @@ -183,8 +171,9 @@ class CRM_Core_DAO_LocationType extends CRM_Core_DAO { 'description' => 'Is this location type the default?', ) , ); + 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()). diff --git a/CRM/Core/DAO/Log.php b/CRM/Core/DAO/Log.php index 90095fc3c4..84a78110e8 100644 --- a/CRM/Core/DAO/Log.php +++ b/CRM/Core/DAO/Log.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Log extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_log'; - /** - * 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 @@ -112,12 +100,13 @@ class CRM_Core_DAO_Log 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_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id'); - 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_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id'); + 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 @@ -125,8 +114,8 @@ class CRM_Core_DAO_Log 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, @@ -170,8 +159,9 @@ class CRM_Core_DAO_Log extends CRM_Core_DAO { 'description' => 'When was the referenced entity created or modified or deleted.', ) , ); + 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()). diff --git a/CRM/Core/DAO/MailSettings.php b/CRM/Core/DAO/MailSettings.php index e2f5454e97..b6b235ab40 100644 --- a/CRM/Core/DAO/MailSettings.php +++ b/CRM/Core/DAO/MailSettings.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_MailSettings extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mail_settings'; - /** - * 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 @@ -160,11 +148,12 @@ class CRM_Core_DAO_MailSettings 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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() , 'domain_id', 'civicrm_domain', '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 @@ -172,8 +161,8 @@ class CRM_Core_DAO_MailSettings 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, @@ -292,8 +281,9 @@ class CRM_Core_DAO_MailSettings extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Core/DAO/Managed.php b/CRM/Core/DAO/Managed.php index 0cec98e7aa..2f003a878a 100644 --- a/CRM/Core/DAO/Managed.php +++ b/CRM/Core/DAO/Managed.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Managed extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_managed'; - /** - * 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 @@ -111,8 +99,8 @@ class CRM_Core_DAO_Managed 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, @@ -168,8 +156,9 @@ class CRM_Core_DAO_Managed extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/Mapping.php b/CRM/Core/DAO/Mapping.php index 66ffe71c91..9d7d795616 100644 --- a/CRM/Core/DAO/Mapping.php +++ b/CRM/Core/DAO/Mapping.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Mapping extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mapping'; - /** - * 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 @@ -99,8 +87,8 @@ class CRM_Core_DAO_Mapping 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, @@ -138,8 +126,9 @@ class CRM_Core_DAO_Mapping extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/MappingField.php b/CRM/Core/DAO/MappingField.php index 518195b7df..a0d6f4f402 100644 --- a/CRM/Core/DAO/MappingField.php +++ b/CRM/Core/DAO/MappingField.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_MappingField extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mapping_field'; - /** - * 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 @@ -160,13 +148,14 @@ class CRM_Core_DAO_MappingField 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_Basic(self::getTableName() , 'mapping_id', 'civicrm_mapping', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_type_id', 'civicrm_location_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_type_id', 'civicrm_relationship_type', '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() , 'mapping_id', 'civicrm_mapping', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_type_id', 'civicrm_location_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'relationship_type_id', 'civicrm_relationship_type', '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 @@ -174,8 +163,8 @@ class CRM_Core_DAO_MappingField 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, @@ -302,8 +291,9 @@ class CRM_Core_DAO_MappingField extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Core/DAO/Menu.php b/CRM/Core/DAO/Menu.php index 8433f57c8d..cc28e3049a 100644 --- a/CRM/Core/DAO/Menu.php +++ b/CRM/Core/DAO/Menu.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Menu extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_menu'; - /** - * 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 @@ -200,12 +188,13 @@ class CRM_Core_DAO_Menu 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', '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 @@ -213,8 +202,8 @@ class CRM_Core_DAO_Menu 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, @@ -375,8 +364,9 @@ class CRM_Core_DAO_Menu extends CRM_Core_DAO { 'description' => 'skip this url being exposed to breadcrumb', ) , ); + 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()). diff --git a/CRM/Core/DAO/MessageTemplate.php b/CRM/Core/DAO/MessageTemplate.php index 5bc734e14b..ce013e6daf 100644 --- a/CRM/Core/DAO/MessageTemplate.php +++ b/CRM/Core/DAO/MessageTemplate.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_MessageTemplate extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_msg_template'; - /** - * 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 @@ -140,8 +128,8 @@ class CRM_Core_DAO_MessageTemplate 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, @@ -224,8 +212,9 @@ class CRM_Core_DAO_MessageTemplate extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/Navigation.php b/CRM/Core/DAO/Navigation.php index 6bd4ef8ebd..488c2afc63 100644 --- a/CRM/Core/DAO/Navigation.php +++ b/CRM/Core/DAO/Navigation.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Navigation extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_navigation'; - /** - * 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 @@ -141,12 +129,13 @@ class CRM_Core_DAO_Navigation 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_navigation', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_navigation', '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 @@ -154,8 +143,8 @@ class CRM_Core_DAO_Navigation 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, @@ -246,8 +235,9 @@ class CRM_Core_DAO_Navigation extends CRM_Core_DAO { 'description' => 'Ordering of the navigation items in various blocks.', ) , ); + 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()). diff --git a/CRM/Core/DAO/Note.php b/CRM/Core/DAO/Note.php index 9a4a3e145a..18e2f25e50 100644 --- a/CRM/Core/DAO/Note.php +++ b/CRM/Core/DAO/Note.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Note extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_note'; - /** - * 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 @@ -124,12 +112,13 @@ class CRM_Core_DAO_Note 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + 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 @@ -137,8 +126,8 @@ class CRM_Core_DAO_Note 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, @@ -218,8 +207,9 @@ class CRM_Core_DAO_Note extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/OpenID.php b/CRM/Core/DAO/OpenID.php index 66345571f4..9e51e029a4 100644 --- a/CRM/Core/DAO/OpenID.php +++ b/CRM/Core/DAO/OpenID.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_OpenID extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_openid'; - /** - * 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 @@ -112,11 +100,12 @@ class CRM_Core_DAO_OpenID 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', '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 @@ -124,8 +113,8 @@ class CRM_Core_DAO_OpenID 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, @@ -174,8 +163,9 @@ class CRM_Core_DAO_OpenID extends CRM_Core_DAO { 'description' => 'Is this the primary email for this contact and location.', ) , ); + 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()). diff --git a/CRM/Core/DAO/OptionGroup.php b/CRM/Core/DAO/OptionGroup.php index 4ba6118492..ffe51316a3 100644 --- a/CRM/Core/DAO/OptionGroup.php +++ b/CRM/Core/DAO/OptionGroup.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_option_group'; - /** - * 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 @@ -117,8 +105,8 @@ class CRM_Core_DAO_OptionGroup 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, @@ -171,8 +159,9 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO { 'description' => 'A lock to remove the ability to add new options via the UI.', ) , ); + 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()). diff --git a/CRM/Core/DAO/OptionValue.php b/CRM/Core/DAO/OptionValue.php index 16d688fe73..b5a603079d 100644 --- a/CRM/Core/DAO/OptionValue.php +++ b/CRM/Core/DAO/OptionValue.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_OptionValue extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_option_value'; - /** - * 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 @@ -171,13 +159,14 @@ class CRM_Core_DAO_OptionValue 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_Basic(self::getTableName() , 'option_group_id', 'civicrm_option_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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() , 'option_group_id', 'civicrm_option_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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 @@ -185,8 +174,8 @@ class CRM_Core_DAO_OptionValue 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, @@ -332,8 +321,9 @@ class CRM_Core_DAO_OptionValue extends CRM_Core_DAO { 'default' => 'NULL', ) , ); + 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()). diff --git a/CRM/Core/DAO/Persistent.php b/CRM/Core/DAO/Persistent.php index d4dc2dc1f0..8ad58a337f 100644 --- a/CRM/Core/DAO/Persistent.php +++ b/CRM/Core/DAO/Persistent.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Persistent extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_persistent'; - /** - * 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 @@ -105,8 +93,8 @@ class CRM_Core_DAO_Persistent 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, @@ -146,8 +134,9 @@ class CRM_Core_DAO_Persistent extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Core/DAO/Phone.php b/CRM/Core/DAO/Phone.php index baff5b289b..2bbf752354 100644 --- a/CRM/Core/DAO/Phone.php +++ b/CRM/Core/DAO/Phone.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Phone extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_phone'; - /** - * 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 @@ -136,11 +124,12 @@ class CRM_Core_DAO_Phone 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', '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 @@ -148,8 +137,8 @@ class CRM_Core_DAO_Phone 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, @@ -250,8 +239,9 @@ class CRM_Core_DAO_Phone extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/PreferencesDate.php b/CRM/Core/DAO/PreferencesDate.php index f71162bd0c..90547c93b1 100644 --- a/CRM/Core/DAO/PreferencesDate.php +++ b/CRM/Core/DAO/PreferencesDate.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_PreferencesDate extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_preferences_date'; - /** - * 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 @@ -116,8 +104,8 @@ class CRM_Core_DAO_PreferencesDate 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, @@ -172,8 +160,9 @@ class CRM_Core_DAO_PreferencesDate extends CRM_Core_DAO { 'size' => CRM_Utils_Type::BIG, ) , ); + 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()). diff --git a/CRM/Core/DAO/PrevNextCache.php b/CRM/Core/DAO/PrevNextCache.php index c0e1709263..e07b29de3a 100644 --- a/CRM/Core/DAO/PrevNextCache.php +++ b/CRM/Core/DAO/PrevNextCache.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_prevnext_cache'; - /** - * 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 @@ -115,8 +103,8 @@ class CRM_Core_DAO_PrevNextCache 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, @@ -165,8 +153,9 @@ class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO { 'title' => ts('Is Selected') , ) , ); + 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()). diff --git a/CRM/Core/DAO/PrintLabel.php b/CRM/Core/DAO/PrintLabel.php index e85d4629af..70fd80b85e 100644 --- a/CRM/Core/DAO/PrintLabel.php +++ b/CRM/Core/DAO/PrintLabel.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_print_label'; - /** - * 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 @@ -141,11 +129,12 @@ class CRM_Core_DAO_PrintLabel 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_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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'); + 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 @@ -153,8 +142,8 @@ class CRM_Core_DAO_PrintLabel 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, @@ -246,8 +235,9 @@ class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); + 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()). diff --git a/CRM/Core/DAO/RecurringEntity.php b/CRM/Core/DAO/RecurringEntity.php index 7b0fe4e4a7..396f64ac82 100644 --- a/CRM/Core/DAO/RecurringEntity.php +++ b/CRM/Core/DAO/RecurringEntity.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_RecurringEntity extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_recurring_entity'; - /** - * 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 @@ -104,8 +92,8 @@ class CRM_Core_DAO_RecurringEntity 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, @@ -143,8 +131,9 @@ class CRM_Core_DAO_RecurringEntity 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()). diff --git a/CRM/Core/DAO/Setting.php b/CRM/Core/DAO/Setting.php index 801dc6cffc..0bdc3bb629 100644 --- a/CRM/Core/DAO/Setting.php +++ b/CRM/Core/DAO/Setting.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Setting extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_setting'; - /** - * 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 @@ -129,14 +117,15 @@ class CRM_Core_DAO_Setting 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'component_id', 'civicrm_component', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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 @@ -144,8 +133,8 @@ class CRM_Core_DAO_Setting 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, @@ -221,8 +210,9 @@ class CRM_Core_DAO_Setting extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); + 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()). diff --git a/CRM/Core/DAO/StateProvince.php b/CRM/Core/DAO/StateProvince.php index ff0d3b210e..a134384c1f 100644 --- a/CRM/Core/DAO/StateProvince.php +++ b/CRM/Core/DAO/StateProvince.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_StateProvince extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_state_province'; - /** - * 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 @@ -100,11 +88,12 @@ class CRM_Core_DAO_StateProvince 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_Basic(self::getTableName() , 'country_id', 'civicrm_country', '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() , 'country_id', 'civicrm_country', '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 @@ -112,8 +101,8 @@ class CRM_Core_DAO_StateProvince 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, @@ -151,8 +140,9 @@ class CRM_Core_DAO_StateProvince extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_Country', ) , ); + 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()). diff --git a/CRM/Core/DAO/StatusPreference.php b/CRM/Core/DAO/StatusPreference.php index 8c55dd0af8..f3415a7f26 100644 --- a/CRM/Core/DAO/StatusPreference.php +++ b/CRM/Core/DAO/StatusPreference.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_StatusPreference extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_status_pref'; - /** - * 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 @@ -118,11 +106,12 @@ class CRM_Core_DAO_StatusPreference 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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() , 'domain_id', 'civicrm_domain', '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 @@ -130,8 +119,8 @@ class CRM_Core_DAO_StatusPreference 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, @@ -210,8 +199,9 @@ class CRM_Core_DAO_StatusPreference extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Core/DAO/SystemLog.php b/CRM/Core/DAO/SystemLog.php index ecb87a1294..fedff4037a 100644 --- a/CRM/Core/DAO/SystemLog.php +++ b/CRM/Core/DAO/SystemLog.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_SystemLog extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_system_log'; - /** - * 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 @@ -117,8 +105,8 @@ class CRM_Core_DAO_SystemLog 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, @@ -172,8 +160,9 @@ class CRM_Core_DAO_SystemLog extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Core/DAO/Tag.php b/CRM/Core/DAO/Tag.php index f2dae21406..75835d6dab 100644 --- a/CRM/Core/DAO/Tag.php +++ b/CRM/Core/DAO/Tag.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Tag extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_tag'; - /** - * 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 @@ -133,12 +121,13 @@ class CRM_Core_DAO_Tag 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_Basic(self::getTableName() , 'parent_id', 'civicrm_tag', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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() , 'parent_id', 'civicrm_tag', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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 @@ -146,8 +135,8 @@ class CRM_Core_DAO_Tag 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, @@ -226,8 +215,9 @@ class CRM_Core_DAO_Tag extends CRM_Core_DAO { 'description' => 'Date and time that tag was created.', ) , ); + 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()). diff --git a/CRM/Core/DAO/Timezone.php b/CRM/Core/DAO/Timezone.php index 2d34c34de7..531ca246e0 100644 --- a/CRM/Core/DAO/Timezone.php +++ b/CRM/Core/DAO/Timezone.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Timezone extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_timezone'; - /** - * 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 @@ -111,11 +99,12 @@ class CRM_Core_DAO_Timezone 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_Basic(self::getTableName() , 'country_id', 'civicrm_country', '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() , 'country_id', 'civicrm_country', '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 @@ -123,8 +112,8 @@ class CRM_Core_DAO_Timezone 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, @@ -170,8 +159,9 @@ class CRM_Core_DAO_Timezone extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_Country', ) , ); + 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()). diff --git a/CRM/Core/DAO/UFField.php b/CRM/Core/DAO/UFField.php index d0ef03695d..d75276f983 100644 --- a/CRM/Core/DAO/UFField.php +++ b/CRM/Core/DAO/UFField.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_UFField extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_uf_field'; - /** - * 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 @@ -190,12 +178,13 @@ class CRM_Core_DAO_UFField 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_Basic(self::getTableName() , 'uf_group_id', 'civicrm_uf_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_type_id', 'civicrm_location_type', '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() , 'uf_group_id', 'civicrm_uf_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_type_id', 'civicrm_location_type', '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 @@ -203,8 +192,8 @@ class CRM_Core_DAO_UFField 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, @@ -352,8 +341,9 @@ class CRM_Core_DAO_UFField extends CRM_Core_DAO { 'description' => 'Include in multi-record listing?', ) , ); + 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()). diff --git a/CRM/Core/DAO/UFGroup.php b/CRM/Core/DAO/UFGroup.php index 8e72eb2cf3..3cc68ab393 100644 --- a/CRM/Core/DAO/UFGroup.php +++ b/CRM/Core/DAO/UFGroup.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_UFGroup extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_uf_group'; - /** - * 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 @@ -213,13 +201,14 @@ class CRM_Core_DAO_UFGroup 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_Basic(self::getTableName() , 'limit_listings_group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'add_to_group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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() , 'limit_listings_group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'add_to_group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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 @@ -227,8 +216,8 @@ class CRM_Core_DAO_UFGroup 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, @@ -403,8 +392,9 @@ class CRM_Core_DAO_UFGroup extends CRM_Core_DAO { 'description' => 'Should we include proximity search feature in this profile search form?', ) , ); + 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()). diff --git a/CRM/Core/DAO/UFJoin.php b/CRM/Core/DAO/UFJoin.php index 82f75371c3..4ae5f57834 100644 --- a/CRM/Core/DAO/UFJoin.php +++ b/CRM/Core/DAO/UFJoin.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_UFJoin extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_uf_join'; - /** - * 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 @@ -124,12 +112,13 @@ class CRM_Core_DAO_UFJoin 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_Basic(self::getTableName() , 'uf_group_id', 'civicrm_uf_group', 'id'); - 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_Basic(self::getTableName() , 'uf_group_id', 'civicrm_uf_group', 'id'); + 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 @@ -137,8 +126,8 @@ class CRM_Core_DAO_UFJoin 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, @@ -210,8 +199,9 @@ class CRM_Core_DAO_UFJoin extends CRM_Core_DAO { 'description' => 'Json serialized array of data used by the ufjoin.module', ) , ); + 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()). diff --git a/CRM/Core/DAO/UFMatch.php b/CRM/Core/DAO/UFMatch.php index ac0c2609bf..43c75f3bfc 100644 --- a/CRM/Core/DAO/UFMatch.php +++ b/CRM/Core/DAO/UFMatch.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_UFMatch extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_uf_match'; - /** - * 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 @@ -112,12 +100,13 @@ class CRM_Core_DAO_UFMatch 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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 @@ -125,8 +114,8 @@ class CRM_Core_DAO_UFMatch 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, @@ -178,8 +167,9 @@ class CRM_Core_DAO_UFMatch extends CRM_Core_DAO { 'size' => CRM_Utils_Type::SIX, ) , ); + 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()). diff --git a/CRM/Core/DAO/Website.php b/CRM/Core/DAO/Website.php index ab1c238ac4..c804993675 100644 --- a/CRM/Core/DAO/Website.php +++ b/CRM/Core/DAO/Website.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Website extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_website'; - /** - * 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 @@ -100,11 +88,12 @@ class CRM_Core_DAO_Website 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', '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 @@ -112,8 +101,8 @@ class CRM_Core_DAO_Website 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, @@ -158,8 +147,9 @@ class CRM_Core_DAO_Website extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/WordReplacement.php b/CRM/Core/DAO/WordReplacement.php index 38371de6c2..d0b0fb4f55 100644 --- a/CRM/Core/DAO/WordReplacement.php +++ b/CRM/Core/DAO/WordReplacement.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_WordReplacement extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_word_replacement'; - /** - * 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 @@ -111,11 +99,12 @@ class CRM_Core_DAO_WordReplacement 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', '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() , 'domain_id', 'civicrm_domain', '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 @@ -123,8 +112,8 @@ class CRM_Core_DAO_WordReplacement 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, @@ -182,8 +171,9 @@ class CRM_Core_DAO_WordReplacement extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Core/DAO/Worldregion.php b/CRM/Core/DAO/Worldregion.php index f3f97698ce..3edc7ff3a3 100644 --- a/CRM/Core/DAO/Worldregion.php +++ b/CRM/Core/DAO/Worldregion.php @@ -41,18 +41,6 @@ class CRM_Core_DAO_Worldregion extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_worldregion'; - /** - * 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 @@ -87,8 +75,8 @@ class CRM_Core_DAO_Worldregion 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, @@ -109,8 +97,9 @@ class CRM_Core_DAO_Worldregion extends CRM_Core_DAO { 'dataPattern' => '', ) , ); + 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()). diff --git a/CRM/Cxn/DAO/Cxn.php b/CRM/Cxn/DAO/Cxn.php index 56550282ea..16fe2001ab 100644 --- a/CRM/Cxn/DAO/Cxn.php +++ b/CRM/Cxn/DAO/Cxn.php @@ -41,18 +41,6 @@ class CRM_Cxn_DAO_Cxn extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_cxn'; - /** - * 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 @@ -141,8 +129,8 @@ class CRM_Cxn_DAO_Cxn 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, @@ -222,8 +210,9 @@ class CRM_Cxn_DAO_Cxn extends CRM_Core_DAO { 'default' => 'NULL', ) , ); + 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()). diff --git a/CRM/Dedupe/DAO/Exception.php b/CRM/Dedupe/DAO/Exception.php index ac2ee43d72..9fd79bb135 100644 --- a/CRM/Dedupe/DAO/Exception.php +++ b/CRM/Dedupe/DAO/Exception.php @@ -41,18 +41,6 @@ class CRM_Dedupe_DAO_Exception extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_dedupe_exception'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Dedupe_DAO_Exception 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_Basic(self::getTableName() , 'contact_id1', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id2', 'civicrm_contact', '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() , 'contact_id1', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id2', 'civicrm_contact', '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 @@ -107,8 +96,8 @@ class CRM_Dedupe_DAO_Exception 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, @@ -131,8 +120,9 @@ class CRM_Dedupe_DAO_Exception extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); + 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()). diff --git a/CRM/Dedupe/DAO/Rule.php b/CRM/Dedupe/DAO/Rule.php index 0e80a60b8e..907ee3210a 100644 --- a/CRM/Dedupe/DAO/Rule.php +++ b/CRM/Dedupe/DAO/Rule.php @@ -41,18 +41,6 @@ class CRM_Dedupe_DAO_Rule extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_dedupe_rule'; - /** - * 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 @@ -112,11 +100,12 @@ class CRM_Dedupe_DAO_Rule 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_Basic(self::getTableName() , 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', '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() , 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', '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 @@ -124,8 +113,8 @@ class CRM_Dedupe_DAO_Rule 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, @@ -179,8 +168,9 @@ class CRM_Dedupe_DAO_Rule extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Dedupe/DAO/RuleGroup.php b/CRM/Dedupe/DAO/RuleGroup.php index d024449ebf..cd4d71112f 100644 --- a/CRM/Dedupe/DAO/RuleGroup.php +++ b/CRM/Dedupe/DAO/RuleGroup.php @@ -41,18 +41,6 @@ class CRM_Dedupe_DAO_RuleGroup extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_dedupe_rule_group'; - /** - * 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 @@ -117,8 +105,8 @@ class CRM_Dedupe_DAO_RuleGroup 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, @@ -197,8 +185,9 @@ class CRM_Dedupe_DAO_RuleGroup extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Event/Cart/DAO/Cart.php b/CRM/Event/Cart/DAO/Cart.php index 3eb2e1c90f..edde650d98 100644 --- a/CRM/Event/Cart/DAO/Cart.php +++ b/CRM/Event/Cart/DAO/Cart.php @@ -41,18 +41,6 @@ class CRM_Event_Cart_DAO_Cart extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_event_carts'; - /** - * 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 @@ -93,11 +81,12 @@ class CRM_Event_Cart_DAO_Cart 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_Basic(self::getTableName() , 'user_id', 'civicrm_contact', '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() , 'user_id', 'civicrm_contact', '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 @@ -105,8 +94,8 @@ class CRM_Event_Cart_DAO_Cart 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( 'cart_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -127,8 +116,9 @@ class CRM_Event_Cart_DAO_Cart extends CRM_Core_DAO { 'title' => ts('Complete?') , ) , ); + 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()). diff --git a/CRM/Event/Cart/DAO/EventInCart.php b/CRM/Event/Cart/DAO/EventInCart.php index f60b8ce431..dbfaeb3c57 100644 --- a/CRM/Event/Cart/DAO/EventInCart.php +++ b/CRM/Event/Cart/DAO/EventInCart.php @@ -41,18 +41,6 @@ class CRM_Event_Cart_DAO_EventInCart extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_events_in_carts'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Event_Cart_DAO_EventInCart 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_Basic(self::getTableName() , 'event_id', 'civicrm_event', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_cart_id', 'civicrm_event_carts', '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() , 'event_id', 'civicrm_event', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_cart_id', 'civicrm_event_carts', '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 @@ -107,8 +96,8 @@ class CRM_Event_Cart_DAO_EventInCart 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( 'event_in_cart_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -131,8 +120,9 @@ class CRM_Event_Cart_DAO_EventInCart extends CRM_Core_DAO { 'FKClassName' => 'CRM_Event_Cart_DAO_Cart', ) , ); + 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()). diff --git a/CRM/Event/DAO/Event.php b/CRM/Event/DAO/Event.php index 31acda1bda..b66507c2a7 100644 --- a/CRM/Event/DAO/Event.php +++ b/CRM/Event/DAO/Event.php @@ -41,18 +41,6 @@ class CRM_Event_DAO_Event extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_event'; - /** - * 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 @@ -489,14 +477,15 @@ class CRM_Event_DAO_Event 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_Basic(self::getTableName() , 'loc_block_id', 'civicrm_loc_block', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', '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() , 'loc_block_id', 'civicrm_loc_block', 'id'); + 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() , 'campaign_id', 'civicrm_campaign', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', '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 @@ -504,8 +493,8 @@ class CRM_Event_DAO_Event 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, @@ -1252,8 +1241,9 @@ class CRM_Event_DAO_Event extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Event/DAO/Participant.php b/CRM/Event/DAO/Participant.php index 7ad37cbcd2..8cec1e7249 100644 --- a/CRM/Event/DAO/Participant.php +++ b/CRM/Event/DAO/Participant.php @@ -41,18 +41,6 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_participant'; - /** - * 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 @@ -189,18 +177,19 @@ class CRM_Event_DAO_Participant 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_id', 'civicrm_event', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_participant_status_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'registered_by_id', 'civicrm_participant', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'discount_id', 'civicrm_discount', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'cart_id', 'civicrm_event_carts', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'transferred_to_contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_id', 'civicrm_event', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_participant_status_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'registered_by_id', 'civicrm_participant', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'discount_id', 'civicrm_discount', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'cart_id', 'civicrm_event_carts', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'transferred_to_contact_id', 'civicrm_contact', '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 @@ -208,8 +197,8 @@ class CRM_Event_DAO_Participant 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( 'participant_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -457,8 +446,9 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); + 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()). diff --git a/CRM/Event/DAO/ParticipantPayment.php b/CRM/Event/DAO/ParticipantPayment.php index 33e2e64f78..b3cca363ff 100644 --- a/CRM/Event/DAO/ParticipantPayment.php +++ b/CRM/Event/DAO/ParticipantPayment.php @@ -41,18 +41,6 @@ class CRM_Event_DAO_ParticipantPayment extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_participant_payment'; - /** - * 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 @@ -94,12 +82,13 @@ class CRM_Event_DAO_ParticipantPayment 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_Basic(self::getTableName() , 'participant_id', 'civicrm_participant', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', '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() , 'participant_id', 'civicrm_participant', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', '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 @@ -107,8 +96,8 @@ class CRM_Event_DAO_ParticipantPayment 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, @@ -133,8 +122,9 @@ class CRM_Event_DAO_ParticipantPayment extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contribute_DAO_Contribution', ) , ); + 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()). diff --git a/CRM/Event/DAO/ParticipantStatusType.php b/CRM/Event/DAO/ParticipantStatusType.php index bac7d1cc5b..0d381e7575 100644 --- a/CRM/Event/DAO/ParticipantStatusType.php +++ b/CRM/Event/DAO/ParticipantStatusType.php @@ -41,18 +41,6 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_participant_status_type'; - /** - * 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 @@ -129,8 +117,8 @@ class CRM_Event_DAO_ParticipantStatusType 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, @@ -213,8 +201,9 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Financial/DAO/Currency.php b/CRM/Financial/DAO/Currency.php index cbcf6170ee..cc86dd0df0 100644 --- a/CRM/Financial/DAO/Currency.php +++ b/CRM/Financial/DAO/Currency.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_Currency extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_currency'; - /** - * 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 @@ -105,8 +93,8 @@ class CRM_Financial_DAO_Currency 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, @@ -166,8 +154,9 @@ class CRM_Financial_DAO_Currency extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Financial/DAO/EntityFinancialAccount.php b/CRM/Financial/DAO/EntityFinancialAccount.php index 2284b8001e..886c229eaa 100644 --- a/CRM/Financial/DAO/EntityFinancialAccount.php +++ b/CRM/Financial/DAO/EntityFinancialAccount.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_EntityFinancialAccount extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_entity_financial_account'; - /** - * 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 @@ -106,12 +94,13 @@ class CRM_Financial_DAO_EntityFinancialAccount 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_Basic(self::getTableName() , 'financial_account_id', 'civicrm_financial_account', 'id'); - 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_Basic(self::getTableName() , 'financial_account_id', 'civicrm_financial_account', 'id'); + 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 @@ -119,8 +108,8 @@ class CRM_Financial_DAO_EntityFinancialAccount 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, @@ -180,8 +169,9 @@ class CRM_Financial_DAO_EntityFinancialAccount extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Financial/DAO/EntityFinancialTrxn.php b/CRM/Financial/DAO/EntityFinancialTrxn.php index b5bde91ddc..bc3478fea6 100644 --- a/CRM/Financial/DAO/EntityFinancialTrxn.php +++ b/CRM/Financial/DAO/EntityFinancialTrxn.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_EntityFinancialTrxn extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_entity_financial_trxn'; - /** - * 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 @@ -104,12 +92,13 @@ class CRM_Financial_DAO_EntityFinancialTrxn 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_Basic(self::getTableName() , 'financial_trxn_id', 'civicrm_financial_trxn', 'id'); - 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_Basic(self::getTableName() , 'financial_trxn_id', 'civicrm_financial_trxn', 'id'); + 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 @@ -117,8 +106,8 @@ class CRM_Financial_DAO_EntityFinancialTrxn 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, @@ -169,8 +158,9 @@ class CRM_Financial_DAO_EntityFinancialTrxn extends CRM_Core_DAO { 'export' => true, ) , ); + 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()). diff --git a/CRM/Financial/DAO/FinancialAccount.php b/CRM/Financial/DAO/FinancialAccount.php index 2eaab01205..c9fa2c037a 100644 --- a/CRM/Financial/DAO/FinancialAccount.php +++ b/CRM/Financial/DAO/FinancialAccount.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_FinancialAccount extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_financial_account'; - /** - * 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 @@ -178,12 +166,13 @@ class CRM_Financial_DAO_FinancialAccount 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_financial_account', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_financial_account', '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,8 +180,8 @@ class CRM_Financial_DAO_FinancialAccount 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, @@ -338,8 +327,9 @@ class CRM_Financial_DAO_FinancialAccount extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Financial/DAO/FinancialItem.php b/CRM/Financial/DAO/FinancialItem.php index 81424f2c43..68a607ebe0 100644 --- a/CRM/Financial/DAO/FinancialItem.php +++ b/CRM/Financial/DAO/FinancialItem.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_FinancialItem extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_financial_item'; - /** - * 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 @@ -141,13 +129,14 @@ class CRM_Financial_DAO_FinancialItem 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_account_id', 'civicrm_financial_account', 'id'); - 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_account_id', 'civicrm_financial_account', 'id'); + 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 @@ -155,8 +144,8 @@ class CRM_Financial_DAO_FinancialItem 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, @@ -277,8 +266,9 @@ class CRM_Financial_DAO_FinancialItem extends CRM_Core_DAO { 'description' => 'The specific source item that is responsible for the creation of this financial_item', ) , ); + 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()). diff --git a/CRM/Financial/DAO/FinancialTrxn.php b/CRM/Financial/DAO/FinancialTrxn.php index 103a44c6da..cef23c730a 100644 --- a/CRM/Financial/DAO/FinancialTrxn.php +++ b/CRM/Financial/DAO/FinancialTrxn.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_financial_trxn'; - /** - * 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 @@ -165,13 +153,14 @@ class CRM_Financial_DAO_FinancialTrxn 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_Basic(self::getTableName() , 'from_financial_account_id', 'civicrm_financial_account', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'to_financial_account_id', 'civicrm_financial_account', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', '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() , 'from_financial_account_id', 'civicrm_financial_account', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'to_financial_account_id', 'civicrm_financial_account', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', '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 @@ -179,8 +168,8 @@ class CRM_Financial_DAO_FinancialTrxn 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, @@ -352,8 +341,9 @@ class CRM_Financial_DAO_FinancialTrxn extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Financial/DAO/FinancialType.php b/CRM/Financial/DAO/FinancialType.php index b6c467c5ce..33397a5d68 100644 --- a/CRM/Financial/DAO/FinancialType.php +++ b/CRM/Financial/DAO/FinancialType.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_FinancialType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_financial_type'; - /** - * 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 @@ -111,8 +99,8 @@ class CRM_Financial_DAO_FinancialType 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, @@ -162,8 +150,9 @@ class CRM_Financial_DAO_FinancialType extends CRM_Core_DAO { 'description' => 'Is this property active?', ) , ); + 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()). diff --git a/CRM/Financial/DAO/PaymentProcessor.php b/CRM/Financial/DAO/PaymentProcessor.php index e2d91e683f..4a78e522b3 100644 --- a/CRM/Financial/DAO/PaymentProcessor.php +++ b/CRM/Financial/DAO/PaymentProcessor.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_payment_processor'; - /** - * 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 @@ -192,12 +180,13 @@ class CRM_Financial_DAO_PaymentProcessor 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_type_id', 'civicrm_payment_processor_type', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_type_id', 'civicrm_payment_processor_type', '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 @@ -205,8 +194,8 @@ class CRM_Financial_DAO_PaymentProcessor 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, @@ -365,8 +354,9 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Financial/DAO/PaymentProcessorType.php b/CRM/Financial/DAO/PaymentProcessorType.php index d1ef543e35..fffa67a0c2 100644 --- a/CRM/Financial/DAO/PaymentProcessorType.php +++ b/CRM/Financial/DAO/PaymentProcessorType.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_payment_processor_type'; - /** - * 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 @@ -200,8 +188,8 @@ class CRM_Financial_DAO_PaymentProcessorType 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, @@ -374,8 +362,9 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Financial/DAO/PaymentToken.php b/CRM/Financial/DAO/PaymentToken.php index acb6914b7a..8bd69afe2c 100644 --- a/CRM/Financial/DAO/PaymentToken.php +++ b/CRM/Financial/DAO/PaymentToken.php @@ -41,18 +41,6 @@ class CRM_Financial_DAO_PaymentToken extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_payment_token'; - /** - * 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 @@ -153,13 +141,14 @@ class CRM_Financial_DAO_PaymentToken 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'payment_processor_id', 'civicrm_payment_processor', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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 @@ -167,8 +156,8 @@ class CRM_Financial_DAO_PaymentToken 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( 'payment_token_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -269,8 +258,9 @@ class CRM_Financial_DAO_PaymentToken extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Friend/DAO/Friend.php b/CRM/Friend/DAO/Friend.php index 105089037d..94b1f249f9 100644 --- a/CRM/Friend/DAO/Friend.php +++ b/CRM/Friend/DAO/Friend.php @@ -41,18 +41,6 @@ class CRM_Friend_DAO_Friend extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_tell_friend'; - /** - * 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 @@ -134,11 +122,12 @@ class CRM_Friend_DAO_Friend 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 @@ -146,8 +135,8 @@ class CRM_Friend_DAO_Friend 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, @@ -244,8 +233,9 @@ class CRM_Friend_DAO_Friend extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Grant/DAO/Grant.php b/CRM/Grant/DAO/Grant.php index 761ed0cbb4..a42dd0359f 100644 --- a/CRM/Grant/DAO/Grant.php +++ b/CRM/Grant/DAO/Grant.php @@ -41,18 +41,6 @@ class CRM_Grant_DAO_Grant extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_grant'; - /** - * 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 @@ -166,12 +154,13 @@ class CRM_Grant_DAO_Grant 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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 @@ -179,8 +168,8 @@ class CRM_Grant_DAO_Grant 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( 'grant_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -404,8 +393,9 @@ class CRM_Grant_DAO_Grant extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Mailing/DAO/BouncePattern.php b/CRM/Mailing/DAO/BouncePattern.php index 127ebae861..b5ba66f27c 100644 --- a/CRM/Mailing/DAO/BouncePattern.php +++ b/CRM/Mailing/DAO/BouncePattern.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_BouncePattern extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_bounce_pattern'; - /** - * 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 @@ -93,11 +81,12 @@ class CRM_Mailing_DAO_BouncePattern 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_Basic(self::getTableName() , 'bounce_type_id', 'civicrm_mailing_bounce_type', '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() , 'bounce_type_id', 'civicrm_mailing_bounce_type', '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 @@ -105,8 +94,8 @@ class CRM_Mailing_DAO_BouncePattern 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, @@ -130,8 +119,9 @@ class CRM_Mailing_DAO_BouncePattern extends CRM_Core_DAO { 'size' => CRM_Utils_Type::HUGE, ) , ); + 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()). diff --git a/CRM/Mailing/DAO/BounceType.php b/CRM/Mailing/DAO/BounceType.php index 72848f53ae..73647fc0f5 100644 --- a/CRM/Mailing/DAO/BounceType.php +++ b/CRM/Mailing/DAO/BounceType.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_BounceType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_bounce_type'; - /** - * 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 @@ -98,8 +86,8 @@ class CRM_Mailing_DAO_BounceType 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, @@ -131,8 +119,9 @@ class CRM_Mailing_DAO_BounceType extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/DAO/Component.php b/CRM/Mailing/DAO/Component.php index 75fe0a893d..10114d85eb 100644 --- a/CRM/Mailing/DAO/Component.php +++ b/CRM/Mailing/DAO/Component.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_Component extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_component'; - /** - * 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 @@ -121,8 +109,8 @@ class CRM_Mailing_DAO_Component 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, @@ -193,8 +181,9 @@ class CRM_Mailing_DAO_Component extends CRM_Core_DAO { 'description' => 'Is this property active?', ) , ); + 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()). diff --git a/CRM/Mailing/DAO/Mailing.php b/CRM/Mailing/DAO/Mailing.php index 11734073eb..0e657af705 100644 --- a/CRM/Mailing/DAO/Mailing.php +++ b/CRM/Mailing/DAO/Mailing.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing'; - /** - * 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 @@ -307,23 +295,24 @@ class CRM_Mailing_DAO_Mailing 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'header_id', 'civicrm_mailing_component', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'footer_id', 'civicrm_mailing_component', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'reply_id', 'civicrm_mailing_component', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'unsubscribe_id', 'civicrm_mailing_component', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'optout_id', 'civicrm_mailing_component', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'msg_template_id', 'civicrm_msg_template', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'scheduled_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'approver_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_provider_id', 'civicrm_sms_provider', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_type_id', 'civicrm_location_type', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'header_id', 'civicrm_mailing_component', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'footer_id', 'civicrm_mailing_component', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'reply_id', 'civicrm_mailing_component', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'unsubscribe_id', 'civicrm_mailing_component', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'optout_id', 'civicrm_mailing_component', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'msg_template_id', 'civicrm_msg_template', 'id'); + 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() , 'scheduled_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'approver_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'sms_provider_id', 'civicrm_sms_provider', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'location_type_id', 'civicrm_location_type', '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 @@ -331,8 +320,8 @@ class CRM_Mailing_DAO_Mailing 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, @@ -684,8 +673,9 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Mailing/DAO/MailingAB.php b/CRM/Mailing/DAO/MailingAB.php index 11adea7df6..fe9472719b 100644 --- a/CRM/Mailing/DAO/MailingAB.php +++ b/CRM/Mailing/DAO/MailingAB.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_MailingAB extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_abtest'; - /** - * 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 @@ -156,11 +144,12 @@ class CRM_Mailing_DAO_MailingAB 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_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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'); + 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 @@ -168,8 +157,8 @@ class CRM_Mailing_DAO_MailingAB 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, @@ -275,8 +264,9 @@ class CRM_Mailing_DAO_MailingAB extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Mailing/DAO/MailingGroup.php b/CRM/Mailing/DAO/MailingGroup.php index 9e85d4a22f..854d5aac40 100644 --- a/CRM/Mailing/DAO/MailingGroup.php +++ b/CRM/Mailing/DAO/MailingGroup.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_MailingGroup extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_group'; - /** - * 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 @@ -117,12 +105,13 @@ class CRM_Mailing_DAO_MailingGroup 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_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', 'id'); - 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_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', 'id'); + 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 @@ -130,8 +119,8 @@ class CRM_Mailing_DAO_MailingGroup 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, @@ -192,8 +181,9 @@ class CRM_Mailing_DAO_MailingGroup extends CRM_Core_DAO { 'description' => 'The arguments to be sent to the search function', ) , ); + 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()). diff --git a/CRM/Mailing/DAO/MailingJob.php b/CRM/Mailing/DAO/MailingJob.php index b101953d96..5d7b7f9978 100644 --- a/CRM/Mailing/DAO/MailingJob.php +++ b/CRM/Mailing/DAO/MailingJob.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_MailingJob extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_job'; - /** - * 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 @@ -141,12 +129,13 @@ class CRM_Mailing_DAO_MailingJob 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_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_mailing_job', '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() , 'mailing_id', 'civicrm_mailing', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_mailing_job', '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 @@ -154,8 +143,8 @@ class CRM_Mailing_DAO_MailingJob 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, @@ -237,8 +226,9 @@ class CRM_Mailing_DAO_MailingJob extends CRM_Core_DAO { 'description' => 'Queue size limit for each child job', ) , ); + 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()). diff --git a/CRM/Mailing/DAO/Recipients.php b/CRM/Mailing/DAO/Recipients.php index 989982a53a..02e15d4fe6 100644 --- a/CRM/Mailing/DAO/Recipients.php +++ b/CRM/Mailing/DAO/Recipients.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_Recipients extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_recipients'; - /** - * 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 @@ -105,14 +93,15 @@ class CRM_Mailing_DAO_Recipients 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_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', '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() , 'mailing_id', 'civicrm_mailing', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', '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 @@ -120,8 +109,8 @@ class CRM_Mailing_DAO_Recipients 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, @@ -161,8 +150,9 @@ class CRM_Mailing_DAO_Recipients extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_Phone', ) , ); + 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()). diff --git a/CRM/Mailing/DAO/Spool.php b/CRM/Mailing/DAO/Spool.php index 20dc068a4e..133b1b15db 100644 --- a/CRM/Mailing/DAO/Spool.php +++ b/CRM/Mailing/DAO/Spool.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_Spool extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_spool'; - /** - * 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 @@ -117,11 +105,12 @@ class CRM_Mailing_DAO_Spool 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_Basic(self::getTableName() , 'job_id', 'civicrm_mailing_job', '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() , 'job_id', 'civicrm_mailing_job', '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 @@ -129,8 +118,8 @@ class CRM_Mailing_DAO_Spool 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, @@ -176,8 +165,9 @@ class CRM_Mailing_DAO_Spool extends CRM_Core_DAO { 'description' => 'date on which this job was removed.', ) , ); + 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()). diff --git a/CRM/Mailing/DAO/TrackableURL.php b/CRM/Mailing/DAO/TrackableURL.php index b9d2e2aea9..1a48f49222 100644 --- a/CRM/Mailing/DAO/TrackableURL.php +++ b/CRM/Mailing/DAO/TrackableURL.php @@ -41,18 +41,6 @@ class CRM_Mailing_DAO_TrackableURL extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_trackable_url'; - /** - * 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 @@ -93,11 +81,12 @@ class CRM_Mailing_DAO_TrackableURL 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_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', '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() , 'mailing_id', 'civicrm_mailing', '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 @@ -105,8 +94,8 @@ class CRM_Mailing_DAO_TrackableURL 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, @@ -129,8 +118,9 @@ class CRM_Mailing_DAO_TrackableURL extends CRM_Core_DAO { 'FKClassName' => 'CRM_Mailing_DAO_Mailing', ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Bounce.php b/CRM/Mailing/Event/DAO/Bounce.php index 3a5cf486f0..eceb52498e 100644 --- a/CRM/Mailing/Event/DAO/Bounce.php +++ b/CRM/Mailing/Event/DAO/Bounce.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_bounce'; - /** - * 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 @@ -105,11 +93,12 @@ class CRM_Mailing_Event_DAO_Bounce 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_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', '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() , 'event_queue_id', 'civicrm_mailing_event_queue', '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 @@ -117,8 +106,8 @@ class CRM_Mailing_Event_DAO_Bounce 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, @@ -163,8 +152,9 @@ class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Confirm.php b/CRM/Mailing/Event/DAO/Confirm.php index 6bd5c58abb..32eaa0c91b 100644 --- a/CRM/Mailing/Event/DAO/Confirm.php +++ b/CRM/Mailing/Event/DAO/Confirm.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Confirm extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_confirm'; - /** - * 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 @@ -93,11 +81,12 @@ class CRM_Mailing_Event_DAO_Confirm 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_Basic(self::getTableName() , 'event_subscribe_id', 'civicrm_mailing_event_subscribe', '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() , 'event_subscribe_id', 'civicrm_mailing_event_subscribe', '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 @@ -105,8 +94,8 @@ class CRM_Mailing_Event_DAO_Confirm 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, @@ -129,8 +118,9 @@ class CRM_Mailing_Event_DAO_Confirm extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Delivered.php b/CRM/Mailing/Event/DAO/Delivered.php index 9d6035e030..b6eadcfa4a 100644 --- a/CRM/Mailing/Event/DAO/Delivered.php +++ b/CRM/Mailing/Event/DAO/Delivered.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Delivered extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_delivered'; - /** - * 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 @@ -93,11 +81,12 @@ class CRM_Mailing_Event_DAO_Delivered 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_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', '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() , 'event_queue_id', 'civicrm_mailing_event_queue', '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 @@ -105,8 +94,8 @@ class CRM_Mailing_Event_DAO_Delivered 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, @@ -129,8 +118,9 @@ class CRM_Mailing_Event_DAO_Delivered extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Forward.php b/CRM/Mailing/Event/DAO/Forward.php index ec40a15ea3..0a4e6e3261 100644 --- a/CRM/Mailing/Event/DAO/Forward.php +++ b/CRM/Mailing/Event/DAO/Forward.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Forward extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_forward'; - /** - * 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 @@ -99,12 +87,13 @@ class CRM_Mailing_Event_DAO_Forward 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_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'dest_queue_id', 'civicrm_mailing_event_queue', '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() , 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'dest_queue_id', 'civicrm_mailing_event_queue', '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 @@ -112,8 +101,8 @@ class CRM_Mailing_Event_DAO_Forward 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, @@ -143,8 +132,9 @@ class CRM_Mailing_Event_DAO_Forward extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Opened.php b/CRM/Mailing/Event/DAO/Opened.php index 6a07125eae..9c56c4def3 100644 --- a/CRM/Mailing/Event/DAO/Opened.php +++ b/CRM/Mailing/Event/DAO/Opened.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Opened extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_opened'; - /** - * 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 @@ -93,11 +81,12 @@ class CRM_Mailing_Event_DAO_Opened 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_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', '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() , 'event_queue_id', 'civicrm_mailing_event_queue', '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 @@ -105,8 +94,8 @@ class CRM_Mailing_Event_DAO_Opened 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, @@ -129,8 +118,9 @@ class CRM_Mailing_Event_DAO_Opened extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Queue.php b/CRM/Mailing/Event/DAO/Queue.php index c27df3561d..be4d1f72aa 100644 --- a/CRM/Mailing/Event/DAO/Queue.php +++ b/CRM/Mailing/Event/DAO/Queue.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Queue extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_queue'; - /** - * 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 @@ -111,14 +99,15 @@ class CRM_Mailing_Event_DAO_Queue 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_Basic(self::getTableName() , 'job_id', 'civicrm_mailing_job', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', '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() , 'job_id', 'civicrm_mailing_job', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'email_id', 'civicrm_email', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'phone_id', 'civicrm_phone', '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 @@ -126,8 +115,8 @@ class CRM_Mailing_Event_DAO_Queue 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, @@ -176,8 +165,9 @@ class CRM_Mailing_Event_DAO_Queue extends CRM_Core_DAO { 'FKClassName' => 'CRM_Core_DAO_Phone', ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Reply.php b/CRM/Mailing/Event/DAO/Reply.php index 54908a8ff4..6ea1276c46 100644 --- a/CRM/Mailing/Event/DAO/Reply.php +++ b/CRM/Mailing/Event/DAO/Reply.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Reply extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_reply'; - /** - * 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 @@ -93,11 +81,12 @@ class CRM_Mailing_Event_DAO_Reply 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_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', '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() , 'event_queue_id', 'civicrm_mailing_event_queue', '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 @@ -105,8 +94,8 @@ class CRM_Mailing_Event_DAO_Reply 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, @@ -129,8 +118,9 @@ class CRM_Mailing_Event_DAO_Reply extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Subscribe.php b/CRM/Mailing/Event/DAO/Subscribe.php index 11fd6ecd58..3a41d3ef6f 100644 --- a/CRM/Mailing/Event/DAO/Subscribe.php +++ b/CRM/Mailing/Event/DAO/Subscribe.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Subscribe extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_subscribe'; - /** - * 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 @@ -105,12 +93,13 @@ class CRM_Mailing_Event_DAO_Subscribe 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_Basic(self::getTableName() , 'group_id', 'civicrm_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'group_id', 'civicrm_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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 @@ -118,8 +107,8 @@ class CRM_Mailing_Event_DAO_Subscribe 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, @@ -167,8 +156,9 @@ class CRM_Mailing_Event_DAO_Subscribe extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/TrackableURLOpen.php b/CRM/Mailing/Event/DAO/TrackableURLOpen.php index d753769020..9dfe72253a 100644 --- a/CRM/Mailing/Event/DAO/TrackableURLOpen.php +++ b/CRM/Mailing/Event/DAO/TrackableURLOpen.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_TrackableURLOpen extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_trackable_url_open'; - /** - * 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 @@ -99,12 +87,13 @@ class CRM_Mailing_Event_DAO_TrackableURLOpen 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_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'trackable_url_id', 'civicrm_mailing_trackable_url', '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() , 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'trackable_url_id', 'civicrm_mailing_trackable_url', '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 @@ -112,8 +101,8 @@ class CRM_Mailing_Event_DAO_TrackableURLOpen 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, @@ -144,8 +133,9 @@ class CRM_Mailing_Event_DAO_TrackableURLOpen extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Mailing/Event/DAO/Unsubscribe.php b/CRM/Mailing/Event/DAO/Unsubscribe.php index a98d39684e..5758e060ad 100644 --- a/CRM/Mailing/Event/DAO/Unsubscribe.php +++ b/CRM/Mailing/Event/DAO/Unsubscribe.php @@ -41,18 +41,6 @@ class CRM_Mailing_Event_DAO_Unsubscribe extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_mailing_event_unsubscribe'; - /** - * 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 @@ -99,11 +87,12 @@ class CRM_Mailing_Event_DAO_Unsubscribe 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_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', '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() , 'event_queue_id', 'civicrm_mailing_event_queue', '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 @@ -111,8 +100,8 @@ class CRM_Mailing_Event_DAO_Unsubscribe 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, @@ -142,8 +131,9 @@ class CRM_Mailing_Event_DAO_Unsubscribe extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Member/DAO/Membership.php b/CRM/Member/DAO/Membership.php index 32e01a78e5..de015403d8 100644 --- a/CRM/Member/DAO/Membership.php +++ b/CRM/Member/DAO/Membership.php @@ -41,18 +41,6 @@ class CRM_Member_DAO_Membership extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_membership'; - /** - * 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 @@ -163,16 +151,17 @@ class CRM_Member_DAO_Membership 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_membership_status', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'owner_membership_id', 'civicrm_membership', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_recur_id', 'civicrm_contribution_recur', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_membership_status', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'owner_membership_id', 'civicrm_membership', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_recur_id', 'civicrm_contribution_recur', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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 @@ -180,8 +169,8 @@ class CRM_Member_DAO_Membership 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( 'membership_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -397,8 +386,9 @@ class CRM_Member_DAO_Membership extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Member/DAO/MembershipBlock.php b/CRM/Member/DAO/MembershipBlock.php index 6dcf57a271..a2fa788a16 100644 --- a/CRM/Member/DAO/MembershipBlock.php +++ b/CRM/Member/DAO/MembershipBlock.php @@ -41,18 +41,6 @@ class CRM_Member_DAO_MembershipBlock extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_membership_block'; - /** - * 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 @@ -154,12 +142,13 @@ class CRM_Member_DAO_MembershipBlock 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_Basic(self::getTableName() , 'entity_id', 'civicrm_contribution_page', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_default', 'civicrm_membership_type', '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() , 'entity_id', 'civicrm_contribution_page', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_default', 'civicrm_membership_type', '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 @@ -167,8 +156,8 @@ class CRM_Member_DAO_MembershipBlock 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, @@ -263,8 +252,9 @@ class CRM_Member_DAO_MembershipBlock 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()). diff --git a/CRM/Member/DAO/MembershipLog.php b/CRM/Member/DAO/MembershipLog.php index c5066b1cc3..f1a4f443e1 100644 --- a/CRM/Member/DAO/MembershipLog.php +++ b/CRM/Member/DAO/MembershipLog.php @@ -41,18 +41,6 @@ class CRM_Member_DAO_MembershipLog extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_membership_log'; - /** - * 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 @@ -129,14 +117,15 @@ class CRM_Member_DAO_MembershipLog 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_Basic(self::getTableName() , 'membership_id', 'civicrm_membership', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_membership_status', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_id', 'civicrm_membership_type', '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() , 'membership_id', 'civicrm_membership', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_membership_status', '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() , 'membership_type_id', 'civicrm_membership_type', '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 @@ -144,8 +133,8 @@ class CRM_Member_DAO_MembershipLog 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, @@ -207,8 +196,9 @@ class CRM_Member_DAO_MembershipLog extends CRM_Core_DAO { 'description' => 'Maximum number of related memberships.', ) , ); + 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()). diff --git a/CRM/Member/DAO/MembershipPayment.php b/CRM/Member/DAO/MembershipPayment.php index d182036e44..ed5546282e 100644 --- a/CRM/Member/DAO/MembershipPayment.php +++ b/CRM/Member/DAO/MembershipPayment.php @@ -41,18 +41,6 @@ class CRM_Member_DAO_MembershipPayment extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_membership_payment'; - /** - * 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 @@ -93,12 +81,13 @@ class CRM_Member_DAO_MembershipPayment 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_Basic(self::getTableName() , 'membership_id', 'civicrm_membership', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', '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() , 'membership_id', 'civicrm_membership', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', '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 @@ -106,8 +95,8 @@ class CRM_Member_DAO_MembershipPayment 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, @@ -130,8 +119,9 @@ class CRM_Member_DAO_MembershipPayment extends CRM_Core_DAO { 'FKClassName' => 'CRM_Contribute_DAO_Contribution', ) , ); + 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()). diff --git a/CRM/Member/DAO/MembershipStatus.php b/CRM/Member/DAO/MembershipStatus.php index 1c50b59147..7e72a3c16f 100644 --- a/CRM/Member/DAO/MembershipStatus.php +++ b/CRM/Member/DAO/MembershipStatus.php @@ -41,18 +41,6 @@ class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_membership_status'; - /** - * 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 @@ -164,8 +152,8 @@ class CRM_Member_DAO_MembershipStatus 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, @@ -299,8 +287,9 @@ class CRM_Member_DAO_MembershipStatus extends CRM_Core_DAO { 'description' => 'Is this membership_status reserved.', ) , ); + 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()). diff --git a/CRM/Member/DAO/MembershipType.php b/CRM/Member/DAO/MembershipType.php index e13b9c994c..5e0f5d0b2d 100644 --- a/CRM/Member/DAO/MembershipType.php +++ b/CRM/Member/DAO/MembershipType.php @@ -41,18 +41,6 @@ class CRM_Member_DAO_MembershipType extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_membership_type'; - /** - * 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 @@ -199,13 +187,14 @@ class CRM_Member_DAO_MembershipType 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'member_of_contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'member_of_contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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 @@ -213,8 +202,8 @@ class CRM_Member_DAO_MembershipType 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, @@ -411,8 +400,9 @@ class CRM_Member_DAO_MembershipType 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()). diff --git a/CRM/PCP/DAO/PCP.php b/CRM/PCP/DAO/PCP.php index 184e4fca91..aa1ce2effc 100644 --- a/CRM/PCP/DAO/PCP.php +++ b/CRM/PCP/DAO/PCP.php @@ -41,18 +41,6 @@ class CRM_PCP_DAO_PCP extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_pcp'; - /** - * 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 @@ -165,11 +153,12 @@ class CRM_PCP_DAO_PCP 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', '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() , 'contact_id', 'civicrm_contact', '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 @@ -177,8 +166,8 @@ class CRM_PCP_DAO_PCP 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( 'pcp_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -342,8 +331,9 @@ class CRM_PCP_DAO_PCP extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/PCP/DAO/PCPBlock.php b/CRM/PCP/DAO/PCPBlock.php index 51c5f866bf..1efb533399 100644 --- a/CRM/PCP/DAO/PCPBlock.php +++ b/CRM/PCP/DAO/PCPBlock.php @@ -41,18 +41,6 @@ class CRM_PCP_DAO_PCPBlock extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_pcp_block'; - /** - * 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 @@ -153,13 +141,14 @@ class CRM_PCP_DAO_PCPBlock 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_Basic(self::getTableName() , 'supporter_profile_id', 'civicrm_uf_group', 'id'); - self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table'); - self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'target_entity_id', NULL, 'id', 'target_entity_type'); + if (!isset(Civi::$statics[__CLASS__]['links'])) { + Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'supporter_profile_id', 'civicrm_uf_group', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'target_entity_id', NULL, 'id', 'target_entity_type'); + 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 @@ -167,8 +156,8 @@ class CRM_PCP_DAO_PCPBlock 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, @@ -275,8 +264,9 @@ class CRM_PCP_DAO_PCPBlock extends CRM_Core_DAO { 'default' => 'NULL', ) , ); + 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()). diff --git a/CRM/Pledge/DAO/Pledge.php b/CRM/Pledge/DAO/Pledge.php index 60a589a0c0..e471c0e46a 100644 --- a/CRM/Pledge/DAO/Pledge.php +++ b/CRM/Pledge/DAO/Pledge.php @@ -41,18 +41,6 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_pledge'; - /** - * 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 @@ -213,14 +201,15 @@ class CRM_Pledge_DAO_Pledge 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_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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() , 'contact_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'campaign_id', 'civicrm_campaign', '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 @@ -228,8 +217,8 @@ class CRM_Pledge_DAO_Pledge 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( 'pledge_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -517,8 +506,9 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Pledge/DAO/PledgeBlock.php b/CRM/Pledge/DAO/PledgeBlock.php index 50b89493b0..a161cd5562 100644 --- a/CRM/Pledge/DAO/PledgeBlock.php +++ b/CRM/Pledge/DAO/PledgeBlock.php @@ -41,18 +41,6 @@ class CRM_Pledge_DAO_PledgeBlock extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_pledge_block'; - /** - * 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 @@ -142,11 +130,12 @@ class CRM_Pledge_DAO_PledgeBlock 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 @@ -154,8 +143,8 @@ class CRM_Pledge_DAO_PledgeBlock 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, @@ -236,8 +225,9 @@ class CRM_Pledge_DAO_PledgeBlock extends CRM_Core_DAO { 'required' => true, ) , ); + 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()). diff --git a/CRM/Pledge/DAO/PledgePayment.php b/CRM/Pledge/DAO/PledgePayment.php index 98f60338da..50059dd86b 100644 --- a/CRM/Pledge/DAO/PledgePayment.php +++ b/CRM/Pledge/DAO/PledgePayment.php @@ -41,18 +41,6 @@ class CRM_Pledge_DAO_PledgePayment extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_pledge_payment'; - /** - * 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 @@ -134,12 +122,13 @@ class CRM_Pledge_DAO_PledgePayment 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_Basic(self::getTableName() , 'pledge_id', 'civicrm_pledge', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', '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() , 'pledge_id', 'civicrm_pledge', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', '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 @@ -147,8 +136,8 @@ class CRM_Pledge_DAO_PledgePayment 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( 'pledge_payment_id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, @@ -273,8 +262,9 @@ class CRM_Pledge_DAO_PledgePayment extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Price/DAO/LineItem.php b/CRM/Price/DAO/LineItem.php index 1e57610ecf..728fb06068 100644 --- a/CRM/Price/DAO/LineItem.php +++ b/CRM/Price/DAO/LineItem.php @@ -41,18 +41,6 @@ class CRM_Price_DAO_LineItem extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_line_item'; - /** - * 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 @@ -160,15 +148,16 @@ class CRM_Price_DAO_LineItem 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_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'price_field_id', 'civicrm_price_field', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'price_field_value_id', 'civicrm_price_field_value', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); - 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_Basic(self::getTableName() , 'contribution_id', 'civicrm_contribution', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'price_field_id', 'civicrm_price_field', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'price_field_value_id', 'civicrm_price_field_value', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', 'id'); + 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 @@ -176,8 +165,8 @@ class CRM_Price_DAO_LineItem 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, @@ -334,8 +323,9 @@ class CRM_Price_DAO_LineItem extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Price/DAO/PriceField.php b/CRM/Price/DAO/PriceField.php index af87460cb0..f19c899648 100644 --- a/CRM/Price/DAO/PriceField.php +++ b/CRM/Price/DAO/PriceField.php @@ -41,18 +41,6 @@ class CRM_Price_DAO_PriceField extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_price_field'; - /** - * 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 @@ -177,11 +165,12 @@ class CRM_Price_DAO_PriceField 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_Basic(self::getTableName() , 'price_set_id', 'civicrm_price_set', '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() , 'price_set_id', 'civicrm_price_set', '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 @@ -189,8 +178,8 @@ class CRM_Price_DAO_PriceField 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, @@ -371,8 +360,9 @@ class CRM_Price_DAO_PriceField extends CRM_Core_DAO { ) ) , ); + 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()). diff --git a/CRM/Price/DAO/PriceFieldValue.php b/CRM/Price/DAO/PriceFieldValue.php index 5081ef2d0a..cda882a76f 100644 --- a/CRM/Price/DAO/PriceFieldValue.php +++ b/CRM/Price/DAO/PriceFieldValue.php @@ -41,18 +41,6 @@ class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_price_field_value'; - /** - * 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 @@ -178,13 +166,14 @@ class CRM_Price_DAO_PriceFieldValue 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_Basic(self::getTableName() , 'price_field_id', 'civicrm_price_field', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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() , 'price_field_id', 'civicrm_price_field', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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 @@ -192,8 +181,8 @@ class CRM_Price_DAO_PriceFieldValue 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, @@ -378,8 +367,9 @@ class CRM_Price_DAO_PriceFieldValue extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Price/DAO/PriceSet.php b/CRM/Price/DAO/PriceSet.php index dedd093acd..bda7ba9467 100644 --- a/CRM/Price/DAO/PriceSet.php +++ b/CRM/Price/DAO/PriceSet.php @@ -41,18 +41,6 @@ class CRM_Price_DAO_PriceSet extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_price_set'; - /** - * 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 @@ -148,12 +136,13 @@ class CRM_Price_DAO_PriceSet 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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() , 'domain_id', 'civicrm_domain', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'financial_type_id', 'civicrm_financial_type', '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 @@ -161,8 +150,8 @@ class CRM_Price_DAO_PriceSet 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, @@ -304,8 +293,9 @@ class CRM_Price_DAO_PriceSet extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/Price/DAO/PriceSetEntity.php b/CRM/Price/DAO/PriceSetEntity.php index 0d56840eba..663e5511bf 100644 --- a/CRM/Price/DAO/PriceSetEntity.php +++ b/CRM/Price/DAO/PriceSetEntity.php @@ -41,18 +41,6 @@ class CRM_Price_DAO_PriceSetEntity extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_price_set_entity'; - /** - * 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 @@ -100,12 +88,13 @@ class CRM_Price_DAO_PriceSetEntity 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_Basic(self::getTableName() , 'price_set_id', 'civicrm_price_set', 'id'); - 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_Basic(self::getTableName() , 'price_set_id', 'civicrm_price_set', 'id'); + 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 @@ -113,8 +102,8 @@ class CRM_Price_DAO_PriceSetEntity 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, @@ -147,8 +136,9 @@ class CRM_Price_DAO_PriceSetEntity extends CRM_Core_DAO { 'FKClassName' => 'CRM_Price_DAO_PriceSet', ) , ); + 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()). diff --git a/CRM/Queue/DAO/QueueItem.php b/CRM/Queue/DAO/QueueItem.php index d07c926ea7..9647830dfd 100644 --- a/CRM/Queue/DAO/QueueItem.php +++ b/CRM/Queue/DAO/QueueItem.php @@ -41,18 +41,6 @@ class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_queue_item'; - /** - * 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 @@ -109,8 +97,8 @@ class CRM_Queue_DAO_QueueItem 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, @@ -164,8 +152,9 @@ class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO { 'description' => 'Serialized queue', ) , ); + 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()). diff --git a/CRM/Report/DAO/ReportInstance.php b/CRM/Report/DAO/ReportInstance.php index 3370048a17..1cd6fec110 100644 --- a/CRM/Report/DAO/ReportInstance.php +++ b/CRM/Report/DAO/ReportInstance.php @@ -41,18 +41,6 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_report_instance'; - /** - * 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 @@ -201,15 +189,16 @@ class CRM_Report_DAO_ReportInstance 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_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'owner_id', 'civicrm_contact', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'navigation_id', 'civicrm_navigation', 'id'); - self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'drilldown_id', 'civicrm_report_instance', '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() , 'domain_id', 'civicrm_domain', 'id'); + 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() , 'owner_id', 'civicrm_contact', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'navigation_id', 'civicrm_navigation', 'id'); + Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'drilldown_id', 'civicrm_report_instance', '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 @@ -217,8 +206,8 @@ class CRM_Report_DAO_ReportInstance 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, @@ -435,8 +424,9 @@ class CRM_Report_DAO_ReportInstance extends CRM_Core_DAO { ) , ) , ); + 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()). diff --git a/CRM/SMS/DAO/Provider.php b/CRM/SMS/DAO/Provider.php index 5606ad24d9..5dd05aea47 100644 --- a/CRM/SMS/DAO/Provider.php +++ b/CRM/SMS/DAO/Provider.php @@ -41,18 +41,6 @@ class CRM_SMS_DAO_Provider extends CRM_Core_DAO { * @var string */ static $_tableName = 'civicrm_sms_provider'; - /** - * 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 @@ -130,8 +118,8 @@ class CRM_SMS_DAO_Provider 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, @@ -224,8 +212,9 @@ class CRM_SMS_DAO_Provider extends CRM_Core_DAO { ) , ) , ); + 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()). -- 2.25.1