Skip to content
Snippets Groups Projects

ZERO-162-changes

Open Eduarda Lentz Rodrigues da Silva requested to merge ZERO-162-changes into develop
Compare and Show latest version
5 files
+ 41
82
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -2,6 +2,21 @@
declare(strict_types=1);
/**
* Copyright (c) 2024 TechDivision GmbH
* All rights reserved
*
* This product includes proprietary software developed at TechDivision GmbH, Germany
* For more information see https://www.techdivision.com/
*
* To obtain a valid license for using this software please contact us at
* license@techdivision.com
*
* @copyright Copyright (c) 2024 TechDivision GmbH (https://www.techdivision.com)
* @author TechDivision Team Zero <zero@techdivision.com>
* @link https://www.techdivision.com/
*/
namespace Firegento\ContentProvisioning\Model\Console;
use Firegento\ContentProvisioning\Model\Query\GetBlockEntryList as GetBlockEntryList;
@@ -10,7 +25,6 @@ use Firegento\ContentProvisioning\Model\Query\GetFilesContentInformation;
use Firegento\ContentProvisioning\Model\RenderChangedBlockList;
use Magento\Framework\Exception\LocalizedException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -107,38 +121,4 @@ class BlockListCommand extends Command
$files = $this->GetFilesContentInformation->execute();
return $this->getChangedBlocksIdentifier->execute($files);
}
/**
* Return array with block information from content_provisioning file
* @param array $files
* @return array
* @throws \Exception
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
*/
public function getBlockInformation(array $files): array
{
$results = [];
foreach ($files as $fileName => $fileContent) {
try {
$xml = new \SimpleXMLElement($fileContent);
foreach ($xml->block as $block) {
$stores = (string)(isset($block->stores->store) && $block->stores->store->attributes() ?
$block->stores->store->attributes()->code : null);
$results[] = [
'identifier' => (string)$block['identifier'],
'key' => (string)$block['key'],
'content' => (string)$block->content,
'stores' => $stores,
'is_active' => (string)$block['active'] ? 'yes' : 'no',
'is_maintained' => (string)$block['maintained'] ? 'yes' : 'no',
'title' => $block->title
];
}
} catch (LocalizedException $e) {
error_log($e->getMessage());
}
}
return $results;
}
}
Loading