Skip to content

Commit

Permalink
Merge pull request #28827 from colemanw/getReferenceColumns
Browse files Browse the repository at this point in the history
DAO - Return reference columns based on field metadata
  • Loading branch information
eileenmcnaughton authored Jan 3, 2024
2 parents 5b917f8 + e0d595a commit 4fe786f
Show file tree
Hide file tree
Showing 136 changed files with 509 additions and 2,329 deletions.
19 changes: 3 additions & 16 deletions CRM/ACL/DAO/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/ACL/ACL.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:d49159426e04e1bab16768e2f7ed9551)
* (GenCodeChecksum:3d1a53d2aa2092299ce1a5b5ceb468f1)
*/

/**
Expand Down Expand Up @@ -166,21 +166,6 @@ public static function getEntityTitle($plural = FALSE) {
return $plural ? ts('ACLs') : ts('ACL');
}

/**
* 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_Dynamic(self::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
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
*
Expand Down Expand Up @@ -295,6 +280,8 @@ public static function &fields() {
'entity' => 'ACL',
'bao' => 'CRM_ACL_BAO_ACL',
'localizable' => 0,
'DFKEntityColumn' => 'entity_table',
'FKColumnName' => 'id',
'pseudoconstant' => [
'optionGroupName' => 'acl_role',
'optionEditPath' => 'civicrm/admin/options/acl_role',
Expand Down
18 changes: 2 additions & 16 deletions CRM/ACL/DAO/ACLCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/ACL/ACLCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:9c12474c5ca5cb7ebdd2863c0d196fdd)
* (GenCodeChecksum:a4f7301d73ae6c7771075e585f120059)
*/

/**
Expand Down Expand Up @@ -84,21 +84,6 @@ public static function getEntityTitle($plural = FALSE) {
return $plural ? ts('ACLCaches') : ts('ACLCache');
}

/**
* 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(), 'acl_id', 'civicrm_acl', '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
*
Expand Down Expand Up @@ -170,6 +155,7 @@ public static function &fields() {
'bao' => 'CRM_ACL_DAO_ACLCache',
'localizable' => 0,
'FKClassName' => 'CRM_ACL_DAO_ACL',
'FKColumnName' => 'id',
'html' => [
'label' => ts("ACL"),
],
Expand Down
19 changes: 3 additions & 16 deletions CRM/ACL/DAO/ACLEntityRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/ACL/ACLEntityRole.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:40a405c8fced6fcaf672b6f7986ac941)
* (GenCodeChecksum:864dfaaffafb1aac5963e88c3b847c56)
*/

/**
Expand Down Expand Up @@ -105,21 +105,6 @@ public static function getEntityTitle($plural = FALSE) {
return $plural ? ts('ACL Role Assignments') : ts('ACL Role Assignment');
}

/**
* 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_Dynamic(self::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
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
*
Expand Down Expand Up @@ -215,6 +200,8 @@ public static function &fields() {
'entity' => 'ACLEntityRole',
'bao' => 'CRM_ACL_BAO_ACLEntityRole',
'localizable' => 0,
'DFKEntityColumn' => 'entity_table',
'FKColumnName' => 'id',
'add' => '1.6',
],
'is_active' => [
Expand Down
26 changes: 6 additions & 20 deletions CRM/Activity/DAO/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Activity/Activity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:ffa034666119a99fd35c5cf8955b8ecc)
* (GenCodeChecksum:18d2e627738109617e50c084979441c0)
*/

/**
Expand Down Expand Up @@ -323,25 +323,6 @@ public static function getEntityDescription() {
return ts('Past or future actions concerning one or more contacts.');
}

/**
* 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(), '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 Civi::$statics[__CLASS__]['links'];
}

/**
* Returns all the column names of this table
*
Expand Down Expand Up @@ -545,6 +526,7 @@ public static function &fields() {
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
'FKClassName' => 'CRM_Core_DAO_Phone',
'FKColumnName' => 'id',
'deprecated' => TRUE,
'html' => [
'type' => 'EntityRef',
Expand Down Expand Up @@ -672,6 +654,7 @@ public static function &fields() {
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
'FKClassName' => 'CRM_Activity_DAO_Activity',
'FKColumnName' => 'id',
'html' => [
'label' => ts("Parent Activity"),
],
Expand Down Expand Up @@ -766,6 +749,7 @@ public static function &fields() {
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Relationship',
'FKColumnName' => 'id',
'deprecated' => TRUE,
'html' => [
'label' => ts("Relationship"),
Expand Down Expand Up @@ -810,6 +794,7 @@ public static function &fields() {
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
'FKClassName' => 'CRM_Activity_DAO_Activity',
'FKColumnName' => 'id',
'deprecated' => TRUE,
'html' => [
'label' => ts("Original Activity"),
Expand Down Expand Up @@ -881,6 +866,7 @@ public static function &fields() {
'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0,
'FKClassName' => 'CRM_Campaign_DAO_Campaign',
'FKColumnName' => 'id',
'component' => 'CiviCampaign',
'html' => [
'type' => 'EntityRef',
Expand Down
20 changes: 3 additions & 17 deletions CRM/Activity/DAO/ActivityContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Activity/ActivityContact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:fd1feb6c83534a381e35804ae722914d)
* (GenCodeChecksum:1e56caf678b48133edb050534211993a)
*/

/**
Expand Down Expand Up @@ -84,22 +84,6 @@ public static function getEntityTitle($plural = FALSE) {
return $plural ? ts('Activity Contacts') : ts('Activity Contact');
}

/**
* 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(), '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 Civi::$statics[__CLASS__]['links'];
}

/**
* Returns all the column names of this table
*
Expand Down Expand Up @@ -149,6 +133,7 @@ public static function &fields() {
'bao' => 'CRM_Activity_BAO_ActivityContact',
'localizable' => 0,
'FKClassName' => 'CRM_Activity_DAO_Activity',
'FKColumnName' => 'id',
'html' => [
'label' => ts("Activity"),
],
Expand All @@ -174,6 +159,7 @@ public static function &fields() {
'bao' => 'CRM_Activity_BAO_ActivityContact',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Contact',
'FKColumnName' => 'id',
'html' => [
'label' => ts("Contact"),
],
Expand Down
22 changes: 4 additions & 18 deletions CRM/Batch/DAO/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Batch/Batch.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:b4f4971d181f79d33d8cd13fb54ea14b)
* (GenCodeChecksum:9b0fed60412874a7e3ebcaabe143bb18)
*/

/**
Expand Down Expand Up @@ -206,23 +206,6 @@ public static function getEntityTitle($plural = FALSE) {
return $plural ? ts('Batches') : ts('Batch');
}

/**
* 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(), '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 Civi::$statics[__CLASS__]['links'];
}

/**
* Returns all the column names of this table
*
Expand Down Expand Up @@ -340,6 +323,7 @@ public static function &fields() {
'bao' => 'CRM_Batch_BAO_Batch',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Contact',
'FKColumnName' => 'id',
'html' => [
'label' => ts("Created By"),
],
Expand Down Expand Up @@ -384,6 +368,7 @@ public static function &fields() {
'bao' => 'CRM_Batch_BAO_Batch',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Contact',
'FKColumnName' => 'id',
'html' => [
'label' => ts("Modified By"),
],
Expand Down Expand Up @@ -425,6 +410,7 @@ public static function &fields() {
'bao' => 'CRM_Batch_BAO_Batch',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
'FKColumnName' => 'id',
'html' => [
'type' => 'EntityRef',
'label' => ts("Smart Group"),
Expand Down
21 changes: 4 additions & 17 deletions CRM/Batch/DAO/EntityBatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Batch/EntityBatch.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:3aeab19bbe2e645ffa8a149e2819d3a7)
* (GenCodeChecksum:c2622d64e4cab3d7fb2a2b1cc2424efd)
*/

/**
Expand Down Expand Up @@ -84,22 +84,6 @@ public static function getEntityTitle($plural = FALSE) {
return $plural ? ts('Entity Batches') : ts('Entity Batch');
}

/**
* 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(), '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 Civi::$statics[__CLASS__]['links'];
}

/**
* Returns all the column names of this table
*
Expand Down Expand Up @@ -172,6 +156,8 @@ public static function &fields() {
'entity' => 'EntityBatch',
'bao' => 'CRM_Batch_BAO_EntityBatch',
'localizable' => 0,
'DFKEntityColumn' => 'entity_table',
'FKColumnName' => 'id',
'add' => '3.3',
],
'batch_id' => [
Expand All @@ -192,6 +178,7 @@ public static function &fields() {
'bao' => 'CRM_Batch_BAO_EntityBatch',
'localizable' => 0,
'FKClassName' => 'CRM_Batch_DAO_Batch',
'FKColumnName' => 'id',
'html' => [
'label' => ts("Batch"),
],
Expand Down
Loading

0 comments on commit 4fe786f

Please sign in to comment.