ListingRequest example

case PluginCategoryService::CATEGORY_NEWCOMER:
                    $filter[] = ['property' => 'newcomer', 'value' => true];
                    break;
                case PluginCategoryService::CATEGORY_RECOMMENDATION:
                    $filter[] = ['property' => 'recommendation', 'value' => true];
                    break;
                default:
                    $filter[] = ['property' => 'categoryId', 'value' => $categoryId];
            }
        }

        $context = new ListingRequest(
            $this->getLocale(),
            $this->getVersion(),
            (int) $this->Request()->getParam('start', 0),
            (int) $this->Request()->getParam('limit', 30),
            $filter,
            $sort
        );

        try {
            $listingResult = $this->get('shopware_plugininstaller.plugin_service_view')->getStoreListing($context);
        } catch (Exception $e) {
            
/** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $shopwareVersion = $this->container->getParameter('shopware.release.version');
        if (!\is_string($shopwareVersion)) {
            throw new RuntimeException('Parameter shopware.release.version has to be an string');
        }

        $context = new ListingRequest('', $shopwareVersion, 0, 1000, [['property' => 'dummy', 'value' => 1]][]);
        $listing = $this->container->get('shopware_plugininstaller.plugin_service_view')->getStoreListing($context);

        $result = [];
        foreach ($listing->getPlugins() as $plugin) {
            $result[] = [
                'id' => $plugin->getId(),
                'technicalName' => $plugin->getTechnicalName(),
                'label' => $plugin->getLabel(),
                'installed' => ($plugin->getInstallationDate() !== null),
                'version' => $plugin->getVersion(),
                'updateAvailable' => $plugin->isUpdateAvailable(),
            ];
Home | Imprint | This part of the site doesn't use cookies.