[MediaWiki-commits] [Gerrit] CRM-18213 remove hard-coding of DAO names - change (wikimedia...civicrm-core)
Eileen has submitted this change and it was merged. Change subject: CRM-18213 remove hard-coding of DAO names .. CRM-18213 remove hard-coding of DAO names Merged into 4.7 Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 --- M CRM/Logging/Differ.php 1 file changed, 2 insertions(+), 19 deletions(-) Approvals: Eileen: Verified; Looks good to me, approved diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 7a5acb2..118726c 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -257,25 +257,8 @@ static $titles = array(); static $values = array(); -// FIXME: split off the table → DAO mapping to a GenCode-generated class -static $daos = array( - 'civicrm_address' => 'CRM_Core_DAO_Address', - 'civicrm_contact' => 'CRM_Contact_DAO_Contact', - 'civicrm_email' => 'CRM_Core_DAO_Email', - 'civicrm_im' => 'CRM_Core_DAO_IM', - 'civicrm_openid' => 'CRM_Core_DAO_OpenID', - 'civicrm_phone' => 'CRM_Core_DAO_Phone', - 'civicrm_website' => 'CRM_Core_DAO_Website', - 'civicrm_contribution' => 'CRM_Contribute_DAO_Contribution', - 'civicrm_note' => 'CRM_Core_DAO_Note', - 'civicrm_relationship' => 'CRM_Contact_DAO_Relationship', - 'civicrm_activity' => 'CRM_Activity_DAO_Activity', - 'civicrm_case' => 'CRM_Case_DAO_Case', -); - if (!isset($titles[$table]) or !isset($values[$table])) { - - if (in_array($table, array_keys($daos))) { + if (($tableDAO = CRM_Core_DAO_AllCoreTables::getClassForTable($table)) != FALSE) { // FIXME: these should be populated with pseudo constants as they // were at the time of logging rather than their current values // FIXME: Use *_BAO:buildOptions() method rather than pseudoconstants & fetch programmatically @@ -311,7 +294,7 @@ break; } -$dao = new $daos[$table](); +$dao = new $tableDAO(); foreach ($dao->fields() as $field) { $titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field); -- To view, visit https://gerrit.wikimedia.org/r/285852 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/civicrm-core Gerrit-Branch: civi-4.6.9 Gerrit-Owner: EileenGerrit-Reviewer: Eileen ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CRM-18213 remove hard-coding of DAO names - change (wikimedia...civicrm-core)
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/285852 Change subject: CRM-18213 remove hard-coding of DAO names .. CRM-18213 remove hard-coding of DAO names Merged into 4.7 Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 --- M CRM/Logging/Differ.php 1 file changed, 2 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/civicrm-core refs/changes/52/285852/1 diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 7a5acb2..118726c 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -257,25 +257,8 @@ static $titles = array(); static $values = array(); -// FIXME: split off the table → DAO mapping to a GenCode-generated class -static $daos = array( - 'civicrm_address' => 'CRM_Core_DAO_Address', - 'civicrm_contact' => 'CRM_Contact_DAO_Contact', - 'civicrm_email' => 'CRM_Core_DAO_Email', - 'civicrm_im' => 'CRM_Core_DAO_IM', - 'civicrm_openid' => 'CRM_Core_DAO_OpenID', - 'civicrm_phone' => 'CRM_Core_DAO_Phone', - 'civicrm_website' => 'CRM_Core_DAO_Website', - 'civicrm_contribution' => 'CRM_Contribute_DAO_Contribution', - 'civicrm_note' => 'CRM_Core_DAO_Note', - 'civicrm_relationship' => 'CRM_Contact_DAO_Relationship', - 'civicrm_activity' => 'CRM_Activity_DAO_Activity', - 'civicrm_case' => 'CRM_Case_DAO_Case', -); - if (!isset($titles[$table]) or !isset($values[$table])) { - - if (in_array($table, array_keys($daos))) { + if (($tableDAO = CRM_Core_DAO_AllCoreTables::getClassForTable($table)) != FALSE) { // FIXME: these should be populated with pseudo constants as they // were at the time of logging rather than their current values // FIXME: Use *_BAO:buildOptions() method rather than pseudoconstants & fetch programmatically @@ -311,7 +294,7 @@ break; } -$dao = new $daos[$table](); +$dao = new $tableDAO(); foreach ($dao->fields() as $field) { $titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field); -- To view, visit https://gerrit.wikimedia.org/r/285852 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/civicrm-core Gerrit-Branch: civi-4.6.9 Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CRM-18213 remove hard-coding of DAO names - change (wikimedia...civicrm)
Ejegg has submitted this change and it was merged. Change subject: CRM-18213 remove hard-coding of DAO names .. CRM-18213 remove hard-coding of DAO names Merged into 4.7 Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 --- M CRM/Logging/Differ.php 1 file changed, 2 insertions(+), 19 deletions(-) Approvals: Ejegg: Looks good to me, approved jenkins-bot: Verified diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 7a5acb2..118726c 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -257,25 +257,8 @@ static $titles = array(); static $values = array(); -// FIXME: split off the table → DAO mapping to a GenCode-generated class -static $daos = array( - 'civicrm_address' => 'CRM_Core_DAO_Address', - 'civicrm_contact' => 'CRM_Contact_DAO_Contact', - 'civicrm_email' => 'CRM_Core_DAO_Email', - 'civicrm_im' => 'CRM_Core_DAO_IM', - 'civicrm_openid' => 'CRM_Core_DAO_OpenID', - 'civicrm_phone' => 'CRM_Core_DAO_Phone', - 'civicrm_website' => 'CRM_Core_DAO_Website', - 'civicrm_contribution' => 'CRM_Contribute_DAO_Contribution', - 'civicrm_note' => 'CRM_Core_DAO_Note', - 'civicrm_relationship' => 'CRM_Contact_DAO_Relationship', - 'civicrm_activity' => 'CRM_Activity_DAO_Activity', - 'civicrm_case' => 'CRM_Case_DAO_Case', -); - if (!isset($titles[$table]) or !isset($values[$table])) { - - if (in_array($table, array_keys($daos))) { + if (($tableDAO = CRM_Core_DAO_AllCoreTables::getClassForTable($table)) != FALSE) { // FIXME: these should be populated with pseudo constants as they // were at the time of logging rather than their current values // FIXME: Use *_BAO:buildOptions() method rather than pseudoconstants & fetch programmatically @@ -311,7 +294,7 @@ break; } -$dao = new $daos[$table](); +$dao = new $tableDAO(); foreach ($dao->fields() as $field) { $titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field); -- To view, visit https://gerrit.wikimedia.org/r/277355 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: EileenGerrit-Reviewer: Awight Gerrit-Reviewer: Ejegg Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] CRM-18213 remove hard-coding of DAO names - change (wikimedia...civicrm)
Eileen has uploaded a new change for review. https://gerrit.wikimedia.org/r/277355 Change subject: CRM-18213 remove hard-coding of DAO names .. CRM-18213 remove hard-coding of DAO names Merged into 4.7 Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 --- M CRM/Logging/Differ.php 1 file changed, 2 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm/civicrm refs/changes/55/277355/1 diff --git a/CRM/Logging/Differ.php b/CRM/Logging/Differ.php index 7a5acb2..118726c 100644 --- a/CRM/Logging/Differ.php +++ b/CRM/Logging/Differ.php @@ -257,25 +257,8 @@ static $titles = array(); static $values = array(); -// FIXME: split off the table → DAO mapping to a GenCode-generated class -static $daos = array( - 'civicrm_address' => 'CRM_Core_DAO_Address', - 'civicrm_contact' => 'CRM_Contact_DAO_Contact', - 'civicrm_email' => 'CRM_Core_DAO_Email', - 'civicrm_im' => 'CRM_Core_DAO_IM', - 'civicrm_openid' => 'CRM_Core_DAO_OpenID', - 'civicrm_phone' => 'CRM_Core_DAO_Phone', - 'civicrm_website' => 'CRM_Core_DAO_Website', - 'civicrm_contribution' => 'CRM_Contribute_DAO_Contribution', - 'civicrm_note' => 'CRM_Core_DAO_Note', - 'civicrm_relationship' => 'CRM_Contact_DAO_Relationship', - 'civicrm_activity' => 'CRM_Activity_DAO_Activity', - 'civicrm_case' => 'CRM_Case_DAO_Case', -); - if (!isset($titles[$table]) or !isset($values[$table])) { - - if (in_array($table, array_keys($daos))) { + if (($tableDAO = CRM_Core_DAO_AllCoreTables::getClassForTable($table)) != FALSE) { // FIXME: these should be populated with pseudo constants as they // were at the time of logging rather than their current values // FIXME: Use *_BAO:buildOptions() method rather than pseudoconstants & fetch programmatically @@ -311,7 +294,7 @@ break; } -$dao = new $daos[$table](); +$dao = new $tableDAO(); foreach ($dao->fields() as $field) { $titles[$table][$field['name']] = CRM_Utils_Array::value('title', $field); -- To view, visit https://gerrit.wikimedia.org/r/277355 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37facda0a751da0e52ca47c595f067df78658a47 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Eileen___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits