// 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;
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);