Skip to content

Commit

Permalink
Merge pull request #25099 from colemanw/defaultLabelField
Browse files Browse the repository at this point in the history
Metadata - Add default labelField to all DAO entities
  • Loading branch information
colemanw authored Dec 5, 2022
2 parents 7d9e496 + 6e11a7c commit 0b7b957
Show file tree
Hide file tree
Showing 24 changed files with 190 additions and 23 deletions.
9 changes: 8 additions & 1 deletion 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:2630e8583922614ba4eb782da52e7baa)
* (GenCodeChecksum:96f70ada6034206619d6ae81d689e126)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_batch';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Case/DAO/CaseType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Case/CaseType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:7279e18d6b15739dbcf3e65dfec6cc59)
* (GenCodeChecksum:83dbb9b5c17d5c9d78f8abbe28c525bb)
*/

/**
Expand All @@ -24,6 +24,13 @@ class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_case_type';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Contribute/DAO/Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contribute/Widget.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:f68b308a17da0c1dc8ef9c7da5f491b0)
* (GenCodeChecksum:7001d44be37f9d78263b115a257bd794)
*/

/**
Expand All @@ -24,6 +24,13 @@ class CRM_Contribute_DAO_Widget extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_contribution_widget';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
6 changes: 6 additions & 0 deletions CRM/Core/CodeGen/Specification.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ public function getTable($tableXML, &$database, &$tables) {

$table['fields'] = &$fields;

// Default label field
if (!$table['labelField']) {
$possibleLabels = ['label', 'title'];
$table['labelField'] = CRM_Utils_Array::first(array_intersect($possibleLabels, array_keys($fields)));
}

if ($this->value('primaryKey', $tableXML)) {
$this->getPrimaryKey($tableXML->primaryKey, $fields, $table);
}
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/ActionSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/ActionSchedule.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:bd11fc1e261257df319b4d4b5dcc6029)
* (GenCodeChecksum:4ab5f20424a3fe5d8b6938822ca65472)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_action_schedule';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/Dashboard.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:ef7b856c97cf255a225d3805cdf57252)
* (GenCodeChecksum:d312724abec4984c66243b7c10793a96)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_Dashboard extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_dashboard';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'label';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/Extension.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:927babbb8e9fee98463a9abd393562ac)
* (GenCodeChecksum:ea1fbfda1b143df90ea7a9f61f27c652)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_Extension extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_extension';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'label';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/Menu.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:dac43d6cbef9b3d10c7e9a55771f7659)
* (GenCodeChecksum:c383a75ee8d3af6ecc1ed78b0dbb4f3a)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_Menu extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_menu';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/OptionGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/OptionGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:b40720432809e0d54c968952b61cb55c)
* (GenCodeChecksum:2ccb4ad1de88c89bdefe80c674d2bc67)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_OptionGroup extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_option_group';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/OptionValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/OptionValue.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:4b75b7b591995e9c6cf5f33bd4fe432e)
* (GenCodeChecksum:fc83389f44b98da86dba941de3611fad)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_OptionValue extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_option_value';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'label';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/PrintLabel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/PrintLabel.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:a1f5695c4f043968286a403f12f7b841)
* (GenCodeChecksum:e26229ab6799aa43ab16eb3cacc532b6)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_print_label';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/UFField.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/UFField.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:f0f7034d728f126559c05d923e6c6bb6)
* (GenCodeChecksum:ef69bec1679ad1fefdfe67722980cf7a)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_UFField extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_uf_field';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'label';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Core/DAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Core/UFGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:856f3bf8203380f334faefd4610307d1)
* (GenCodeChecksum:ede8c05e576822fdbcaaad0405bf7f81)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Core_DAO_UFGroup extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_uf_group';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Dedupe/DAO/DedupeRuleGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Dedupe/DedupeRuleGroup.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:dc8957103d3accc4eb60eb94a3ee2282)
* (GenCodeChecksum:f284352850b87d32288b0f332e44eb41)
*/

/**
Expand All @@ -23,6 +23,13 @@ class CRM_Dedupe_DAO_DedupeRuleGroup extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_dedupe_rule_group';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Event/DAO/ParticipantStatusType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Event/ParticipantStatusType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:20ab64e28a14ebf51e56b3d70ecd7eed)
* (GenCodeChecksum:199d17e543696db3968d8c6770fb20ff)
*/

/**
Expand All @@ -24,6 +24,13 @@ class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_participant_status_type';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'label';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Financial/DAO/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Financial/PaymentProcessor.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:2575f7e04dd116e940eb7161c0619f0a)
* (GenCodeChecksum:a98733540fdf85dcd843078f0d925659)
*/

/**
Expand All @@ -24,6 +24,13 @@ class CRM_Financial_DAO_PaymentProcessor extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_payment_processor';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
9 changes: 8 additions & 1 deletion CRM/Financial/DAO/PaymentProcessorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Financial/PaymentProcessorType.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:adff64f6f2bcedf8d42630fb4cbe7ffa)
* (GenCodeChecksum:b928d1023a411536c1aa09fc58d30091)
*/

/**
Expand All @@ -24,6 +24,13 @@ class CRM_Financial_DAO_PaymentProcessorType extends CRM_Core_DAO {
*/
public static $_tableName = 'civicrm_payment_processor_type';

/**
* Field to show when displaying a record.
*
* @var string
*/
public static $_labelField = 'title';

/**
* Should CiviCRM log any modifications to this table in the civicrm_log table.
*
Expand Down
Loading

0 comments on commit 0b7b957

Please sign in to comment.