doGetRequest example

/** * Gets a list of locales supported by the SBP * * @throws Exception * * @return LocaleStruct[] array of locale details */
    public function getLocales()
    {
        try {
            $responseBody = $this->storeClient->doGetRequest('/locales');
        } catch (StoreException $se) {
            throw $this->translateExceptionMessage($se);
        }

        return $this->hydrator->hydrateLocales($responseBody);
    }

    /** * Get the list of shops (and details) associated to the given user * * @throws Exception * * @return array Array of shop details */

    public function getRecommendedPlugins(?LocaleStruct $locale$shopwareVersion)
    {
        $localeName = $locale ? $locale->getName() : null;

        $data = $this->storeClient->doGetRequest(
            '/firstrunwizard/recommendations',
            ['locale' => $localeName, 'shopwareVersion' => $shopwareVersion]
        );

        $plugins = $this->hydrator->hydrateStorePlugins($data);

        return $this->getAdditionallyLocalData($plugins);
    }

    /** * Loads integrated plugins from SBP * * @param string $isoCode Two letter iso code indicating for which country to get the plugin list * @param string $shopwareVersion Current Shopware version * * @return array List of plugins */
public function getListing(ListingRequest $context)
    {
        $params = [
            'locale' => $context->getLocale(),
            'shopwareVersion' => $context->getShopwareVersion(),
            'offset' => $context->getOffset(),
            'limit' => $context->getLimit(),
            'sort' => json_encode($context->getSortings()),
            'filter' => json_encode($context->getConditions()),
        ];

        $data = $this->storeClient->doGetRequest(
            '/pluginStore/plugins',
            $params
        );

        $plugins = $this->hydrator->hydrateStorePlugins($data['data']);

        return new ListingResultStruct(
            $plugins,
            $data['total']
        );
    }

    
Home | Imprint | This part of the site doesn't use cookies.