diff --git a/Api/Data/ContentEntryInterface.php b/Api/Data/ContentEntryInterface.php index bb5ef7d6d8319c996a0d7693de8bc94ee45c10f3..76ae6d3b006e46a8f3c0bc694def222e5ee1c264 100644 --- a/Api/Data/ContentEntryInterface.php +++ b/Api/Data/ContentEntryInterface.php @@ -13,12 +13,18 @@ interface ContentEntryInterface const CONTENT = 'content'; const STORES = 'stores'; const IS_MAINTAINED = 'is_maintained'; + const KEY = 'key'; /** * @return string */ public function getType(): string; + /** + * @return string + */ + public function getKey(): string; + /** * @return string */ @@ -44,6 +50,11 @@ interface ContentEntryInterface */ public function setType(string $type): void; + /** + * @param string $key + */ + public function setKey(string $key): void; + /** * @param string $identifier */ diff --git a/Model/Config/Converter.php b/Model/Config/Converter.php index 4ff8dde2462cc865290ff164d5a78ef16eba83ae..12358efb87b91d7ac47ddee35c2a67984fc6a45e 100644 --- a/Model/Config/Converter.php +++ b/Model/Config/Converter.php @@ -68,7 +68,9 @@ class Converter implements \Magento\Framework\Config\ConverterInterface $identifier = $this->getAttributeValue($node, 'identifier'); try { $stores = $this->extractStores($node); - $output[$this->buildKey($identifier, $stores, $nodeKey)] = [ + $key = $this->buildKey($identifier, $stores, $nodeKey); + $output[$key] = [ + ContentEntryInterface::KEY => $key, ContentEntryInterface::IDENTIFIER => $identifier, ContentEntryInterface::TYPE => $nodeKey, ContentEntryInterface::IS_MAINTAINED => diff --git a/Model/Console/ListCommand.php b/Model/Console/ListCommand.php index 0a4ec79adc96c2a19c975e50550263e52673aff8..8541cac601beb617f186dab8b20a592c807b4f52 100644 --- a/Model/Console/ListCommand.php +++ b/Model/Console/ListCommand.php @@ -34,10 +34,11 @@ class ListCommand extends Command protected function execute(InputInterface $input, OutputInterface $output) { $table = new Table($output); - $table->setHeaders(['Type', 'Identifier', 'Stores', 'Maintained', 'Content (Teaser)']); + $table->setHeaders(['Key', 'Type', 'Identifier', 'Stores', 'Maintained', 'Content (Teaser)']); foreach ($this->getAllContentEntries->get() as $entry) { $table->addRow([ + $entry->getKey(), $entry->getType(), $entry->getIdentifier(), implode(', ', $entry->getStores()), diff --git a/Model/ContentEntry.php b/Model/ContentEntry.php index fb8ebc9890cc752fdcb70c015b1d3c24c2e6c68b..2f42fd038b5ab58ff8d8633b9c5f91586187b22c 100644 --- a/Model/ContentEntry.php +++ b/Model/ContentEntry.php @@ -16,6 +16,14 @@ class ContentEntry extends DataObject implements ContentEntryInterface return (string)$this->getData(ContentEntryInterface::TYPE); } + /** + * @return string + */ + public function getKey(): string + { + return (string)$this->getData(ContentEntryInterface::KEY); + } + /** * @return string */ @@ -56,6 +64,14 @@ class ContentEntry extends DataObject implements ContentEntryInterface $this->setData(ContentEntryInterface::TYPE, $type); } + /** + * @param string $key + */ + public function setKey(string $key): void + { + $this->setData(ContentEntryInterface::KEY, $key); + } + /** * @param string $identifier */