Skip to content
Snippets Groups Projects
Commit 0573fbca authored by Eduarda Lentz Rodrigues da Silva's avatar Eduarda Lentz Rodrigues da Silva
Browse files

ZERO-162 Added new information to get data from database

parent 99a0c114
No related branches found
No related tags found
1 merge request!46ZERO-162-changes
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment