From 463edb893ffac56945bf80866c0f7afdc456e3e9 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Mon, 11 Nov 2024 10:35:39 +0200 Subject: [PATCH] fix deprecations --- .../RealEstate/Tools/Matches/Jobs/SendRequestMatches.php | 2 +- .../Espo/Modules/RealEstate/Tools/Matches/Service.php | 2 +- src/scripts/AfterInstall.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Jobs/SendRequestMatches.php b/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Jobs/SendRequestMatches.php index aace706..2e97715 100644 --- a/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Jobs/SendRequestMatches.php +++ b/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Jobs/SendRequestMatches.php @@ -112,7 +112,7 @@ public function run(Data $data): void continue; } - $queueItem = $this->entityManager->getEntity('RealEstateSendMatchesQueueItem'); + $queueItem = $this->entityManager->getNewEntity('RealEstateSendMatchesQueueItem'); $queueItem->set([ 'requestId' => $entity->getId(), diff --git a/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Service.php b/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Service.php index dc04780..d5be1da 100644 --- a/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Service.php +++ b/src/files/custom/Espo/Modules/RealEstate/Tools/Matches/Service.php @@ -233,7 +233,7 @@ private function sendMatchesEmail($data): void } foreach ($property->getLinkMultipleIdList('images') as $attachmentId) { - $attachment = $this->entityManager->getEntity('Attachment', $attachmentId); + $attachment = $this->entityManager->getEntityById('Attachment', $attachmentId); if ($attachment) { $attachmentList[] = $attachment; diff --git a/src/scripts/AfterInstall.php b/src/scripts/AfterInstall.php index 11d1e48..13027d3 100644 --- a/src/scripts/AfterInstall.php +++ b/src/scripts/AfterInstall.php @@ -135,7 +135,7 @@ public function run($container) $entityManager = $container->get('entityManager'); if (!$entityManager->getRepository('ScheduledJob')->where(['job' => 'PropertyMatchingUpdate'])->findOne()) { - $job = $entityManager->getEntity('ScheduledJob'); + $job = $entityManager->getNewEntity('ScheduledJob'); $job->set([ 'name' => 'Property Matching Update', 'job' => 'PropertyMatchingUpdate', @@ -145,9 +145,9 @@ public function run($container) $entityManager->saveEntity($job); } if (!$entityManager->getRepository('ScheduledJob')->where(['job' => 'SendPropertyMatches'])->findOne()) { - $job = $entityManager->getEntity('ScheduledJob'); + $job = $entityManager->getNewEntity('ScheduledJob'); $job->set([ - 'name' => 'Send Matched Properties to Requestors', + 'name' => 'Send Matched Properties to Requesters', 'job' => 'SendPropertyMatches', 'status' => 'Active', 'scheduling' => '*/2 * * * *'