From d000a056f8f681f1016ce134c6bbbd92c59d554e Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 26 Aug 2022 16:41:09 +1200 Subject: [PATCH] [REF] Variable use cleanup --- CRM/Core/BAO/UFMatch.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index c3a77a93da..67b04f4ba9 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -215,17 +215,17 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { // ensure there does not exists a contact_id / uf_id pair // in the DB. This might be due to multiple emails per contact // CRM-9091 - $sql = " + $sql = ' SELECT id FROM civicrm_uf_match WHERE contact_id = %1 AND domain_id = %2 -"; - $params = [ +'; + + $conflict = CRM_Core_DAO::singleValueQuery($sql, [ 1 => [$dao->contact_id, 'Integer'], 2 => [CRM_Core_Config::domainID(), 'Integer'], - ]; - $conflict = CRM_Core_DAO::singleValueQuery($sql, $params); + ]); if (!$conflict) { $found = TRUE; @@ -291,14 +291,13 @@ OR uf_name = %2 OR uf_id = %3 ) AND domain_id = %4 "; - $params = [ + + $conflict = CRM_Core_DAO::singleValueQuery($sql, [ 1 => [$ufmatch->contact_id, 'Integer'], 2 => [$ufmatch->uf_name, 'String'], 3 => [$ufmatch->uf_id, 'Integer'], 4 => [$ufmatch->domain_id, 'Integer'], - ]; - - $conflict = CRM_Core_DAO::singleValueQuery($sql, $params); + ]); if (!$conflict) { $ufmatch = CRM_Core_BAO_UFMatch::create((array) $ufmatch); -- 2.25.1