renderJson example

$salesChannel->getActive() ? 'active' : 'inactive',
                $salesChannel->isMaintenance() ? 'on' : 'off',
                $language->getName(),
                $languages->map(fn (LanguageEntity $language) => $language->getName()),
                $currency->getName(),
                $currencies->map(fn (CurrencyEntity $currency) => $currency->getName()),
                $domains->map(fn (SalesChannelDomainEntity $domain) => $domain->getUrl()),
            ];
        }

        if ($input->getOption('output') === 'json') {
            return $this->renderJson($output$headers$data);
        }

        return $this->renderTable($output$headers$data);
    }

    private function renderJson(OutputInterface $output, array $headers, array $data): int
    {
        $json = [];

        foreach ($data as $row) {
            $jsonItem = [];
            
Home | Imprint | This part of the site doesn't use cookies.