From e0d595a2d93e61a4dcd3ddb1123e7694305bb183 Mon Sep 17 00:00:00 2001 From: colemanw Date: Mon, 1 Jan 2024 23:30:12 -0500 Subject: [PATCH] Regenerate Ext DAO files without boilerplate getReferenceColumns() --- .../core/CRM/Afform/DAO/AfformSubmission.php | 15 --------- ext/civigrant/CRM/Grant/DAO/Grant.php | 16 ---------- .../CRM/Search/DAO/SearchDisplay.php | 15 --------- .../CRM/Standaloneusers/DAO/Session.php | 31 ------------------- .../CRM/Standaloneusers/DAO/User.php | 16 ---------- .../CRM/Standaloneusers/DAO/UserRole.php | 16 ---------- 6 files changed, 109 deletions(-) diff --git a/ext/afform/core/CRM/Afform/DAO/AfformSubmission.php b/ext/afform/core/CRM/Afform/DAO/AfformSubmission.php index a83b0c6a5e..3e0053f4da 100644 --- a/ext/afform/core/CRM/Afform/DAO/AfformSubmission.php +++ b/ext/afform/core/CRM/Afform/DAO/AfformSubmission.php @@ -108,21 +108,6 @@ class CRM_Afform_DAO_AfformSubmission extends CRM_Core_DAO { return $plural ? E::ts('FormBuilder Submissions') : E::ts('FormBuilder Submission'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - 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 Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * diff --git a/ext/civigrant/CRM/Grant/DAO/Grant.php b/ext/civigrant/CRM/Grant/DAO/Grant.php index aa20b3c3d1..5131367f28 100644 --- a/ext/civigrant/CRM/Grant/DAO/Grant.php +++ b/ext/civigrant/CRM/Grant/DAO/Grant.php @@ -212,22 +212,6 @@ class CRM_Grant_DAO_Grant extends CRM_Core_DAO { return E::ts('Funds applied for and given out by this organization.'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - 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 Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * diff --git a/ext/search_kit/CRM/Search/DAO/SearchDisplay.php b/ext/search_kit/CRM/Search/DAO/SearchDisplay.php index 2e7cf49789..6ab68bc979 100644 --- a/ext/search_kit/CRM/Search/DAO/SearchDisplay.php +++ b/ext/search_kit/CRM/Search/DAO/SearchDisplay.php @@ -126,21 +126,6 @@ class CRM_Search_DAO_SearchDisplay extends CRM_Core_DAO { return $plural ? E::ts('Search Displays') : E::ts('Search Display'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - 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'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * diff --git a/ext/standaloneusers/CRM/Standaloneusers/DAO/Session.php b/ext/standaloneusers/CRM/Standaloneusers/DAO/Session.php index 230951ff67..5ed463acd7 100644 --- a/ext/standaloneusers/CRM/Standaloneusers/DAO/Session.php +++ b/ext/standaloneusers/CRM/Standaloneusers/DAO/Session.php @@ -182,37 +182,6 @@ class CRM_Standaloneusers_DAO_Session extends CRM_Core_DAO { return Civi::$statics[__CLASS__]['fields']; } - /** - * Return a mapping from field-name to the corresponding key (as used in fields()). - * - * @return array - * Array(string $name => string $uniqueName). - */ - public static function &fieldKeys() { - if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { - Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); - } - return Civi::$statics[__CLASS__]['fieldKeys']; - } - - /** - * Returns the names of this table - * - * @return string - */ - public static function getTableName() { - return self::$_tableName; - } - - /** - * Returns if this table needs to be logged - * - * @return bool - */ - public function getLog() { - return self::$_log; - } - /** * Returns the list of fields that can be imported * diff --git a/ext/standaloneusers/CRM/Standaloneusers/DAO/User.php b/ext/standaloneusers/CRM/Standaloneusers/DAO/User.php index 8208e2b5b4..925ef0bbb4 100644 --- a/ext/standaloneusers/CRM/Standaloneusers/DAO/User.php +++ b/ext/standaloneusers/CRM/Standaloneusers/DAO/User.php @@ -182,22 +182,6 @@ class CRM_Standaloneusers_DAO_User extends CRM_Core_DAO { return $plural ? E::ts('Users') : E::ts('User'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - 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 Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * diff --git a/ext/standaloneusers/CRM/Standaloneusers/DAO/UserRole.php b/ext/standaloneusers/CRM/Standaloneusers/DAO/UserRole.php index eb77ccddd7..1e33a65579 100644 --- a/ext/standaloneusers/CRM/Standaloneusers/DAO/UserRole.php +++ b/ext/standaloneusers/CRM/Standaloneusers/DAO/UserRole.php @@ -76,22 +76,6 @@ class CRM_Standaloneusers_DAO_UserRole extends CRM_Core_DAO { return $plural ? E::ts('User Roles') : E::ts('User Role'); } - /** - * Returns foreign keys and entity references. - * - * @return array - * [CRM_Core_Reference_Interface] - */ - public static function getReferenceColumns() { - 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_uf_match', 'id'); - Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'role_id', 'civicrm_role', 'id'); - CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); - } - return Civi::$statics[__CLASS__]['links']; - } - /** * Returns all the column names of this table * -- 2.25.1