Skip to content

Commit

Permalink
Update code_samples/api/public_php_api/src/Command/ViewContentMetaDat…
Browse files Browse the repository at this point in the history
…aCommand.php

Co-authored-by: Paweł Niedzielski <pawel.niedzielski@ibexa.co>
  • Loading branch information
mnocon and Steveb-p authored Jul 15, 2024
1 parent 35ef89b commit f7cdc41
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln(' in ' . $versionInfo->getInitialLanguage()->name);
}

$versionInfoArray = iterator_to_array($this->contentService->loadVersions($contentInfo, VersionInfo::STATUS_ARCHIVED));
$versionInfoArray = $this->contentService->loadVersions($contentInfo, VersionInfo::STATUS_ARCHIVED);
if ($versionInfoArray instanceof \Traversable) {
$versionInfoArray = iterator_to_array($versionInfoArray);
}
if (count($versionInfoArray)) {
$output->writeln('Archived versions:');
foreach ($versionInfoArray as $versionInfo) {
Expand Down

0 comments on commit f7cdc41

Please sign in to comment.