From 0573fbcae8ae5a8d3e41e4c6febdeb9ee86464be Mon Sep 17 00:00:00 2001 From: Eduarda Lentz Rodrigues da Silva <e.lentzrodriguesdasilva@techdivision.com> Date: Mon, 20 Jan 2025 12:04:49 +0100 Subject: [PATCH] ZERO-162 Added new information to get data from database --- Model/Query/GetChangedBlockIdentifiers.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Model/Query/GetChangedBlockIdentifiers.php b/Model/Query/GetChangedBlockIdentifiers.php index 8240d16..15d0166 100644 --- a/Model/Query/GetChangedBlockIdentifiers.php +++ b/Model/Query/GetChangedBlockIdentifiers.php @@ -27,13 +27,21 @@ class GetChangedBlockIdentifiers */ private GetBlockEntryByKey $getBlockEntryByKey; + /** + * @var GetCmsBlockByTitle + */ + private GetCmsBlockByTitle $getCmsBlockByTitle; + /** * @param GetBlockEntryByKey $getBlockEntryByKey + * @param GetCmsBlockByTitle $getCmsBlockByTitle */ public function __construct( GetBlockEntryByKey $getBlockEntryByKey, + GetCmsBlockByTitle $getCmsBlockByTitle ) { $this->getBlockEntryByKey = $getBlockEntryByKey; + $this->getCmsBlockByTitle = $getCmsBlockByTitle; } /** @@ -50,7 +58,8 @@ class GetChangedBlockIdentifiers // Get Block content from code $codeFileContent = $file['content']; // Get Block content from database - $dbBlockContent = $this->getBlockEntryByKey->get($file['key'])->getContent(); + $dbBlock = $this->getCmsBlockByTitle->execute($file['title']); + $dbBlockContent = $dbBlock['content']; } catch (LocalizedException $e) { return 'ERROR: ' . $e->getMessage(); } -- GitLab