From d4ea6d146ae57eef362de7f442062354ac4ee472 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 18 Jan 2019 16:37:24 +0200 Subject: [PATCH] fix --- application/Espo/Core/Templates/Services/Person.php | 12 ++++++------ application/Espo/Modules/Crm/Services/Account.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/Espo/Core/Templates/Services/Person.php b/application/Espo/Core/Templates/Services/Person.php index 7aaf1a0763..31a08edda2 100644 --- a/application/Espo/Core/Templates/Services/Person.php +++ b/application/Espo/Core/Templates/Services/Person.php @@ -35,15 +35,15 @@ class Person extends \Espo\Services\Record { protected function getDuplicateWhereClause(Entity $entity, $data) { - $data = array( + $whereClause = [ 'OR' => [] - ); + ]; $toCheck = false; if ($entity->get('firstName') || $entity->get('lastName')) { $part = []; $part['firstName'] = $entity->get('firstName'); $part['lastName'] = $entity->get('lastName'); - $data['OR'][] = $part; + $whereClause['OR'][] = $part; $toCheck = true; } if ( @@ -62,9 +62,9 @@ class Person extends \Espo\Services\Record } } foreach ($list as $emailAddress) { - $data['OR'][] = array( + $whereClause['OR'][] = [ 'emailAddress' => $emailAddress - ); + ]; $toCheck = true; } } @@ -72,7 +72,7 @@ class Person extends \Espo\Services\Record return false; } - return $data; + return $whereClause; } } diff --git a/application/Espo/Modules/Crm/Services/Account.php b/application/Espo/Modules/Crm/Services/Account.php index 66f2c56e09..01cb56d508 100644 --- a/application/Espo/Modules/Crm/Services/Account.php +++ b/application/Espo/Modules/Crm/Services/Account.php @@ -52,9 +52,9 @@ class Account extends \Espo\Services\Record if (!$entity->get('name')) { return false; } - return array( + return [ 'name' => $entity->get('name') - ); + ]; } protected function afterMerge(Entity $entity, array $sourceList, $attributes)