getLicences example

return;
        }

        $context = new LicenceRequest(
            $this->getLocale(),
            $this->getVersion(),
            $this->getDomain(),
            $accessToken
        );

        try {
            $licences = $this->get(PluginStoreService::class)->getLicences($context);
        } catch (Exception $e) {
            $this->handleException($e);

            return;
        }

        $this->View()->assign([
            'success' => true,
            'data' => array_values($licences),
        ]);
    }

    
public function completeArgumentValues($argumentName, CompletionContext $context)
    {
        if ($argumentName === 'technical-name') {
            if (!\is_null($token = $this->getAuthenticationFromArguments($context->getWords()))) {
                $context = new LicenceRequest('en_GB', $this->getVersionFromArguments($context->getWords())$this->getDomainFromArguments($context->getWords())$token);

                /** @var PluginStoreService $pluginStoreService */
                $pluginStoreService = $this->container->get(PluginStoreService::class);

                return array_map(function DLicenceStruct $licence) {
                    return $licence->getTechnicalName();
                }$pluginStoreService->getLicences($context));
            }
        }

        return [];
    }

    /** * {@inheritdoc} */
    protected function configure()
    {
        
$domain = $this->setupDomain($input$output);

        $context = new LicenceRequest(
            '',
            $version,
            $domain,
            $token
        );

        try {
            $licences = $this->container->get(\Shopware\Bundle\PluginInstallerBundle\Service\PluginStoreService::class)
                ->getLicences($context);
        } catch (Exception $e) {
            $this->handleError([
                'message' => $e->getMessage(),
            ]);

            return 0;
        }

        $result = null;

        /** @var LicenceStruct $licence */
        
return $response;
    }

    /** * function to get expired and soon expiring plugins * * @return PluginInformationStruct[] */
    public function getExpiringLicenses()
    {
        $expiringPluginLicenses = [];
        $licenses = $this->getLicences();

        if (empty($licenses)) {
            return $expiringPluginLicenses;
        }
        $expirations = $this->getExpirations($licenses);
        foreach ($expirations as $expiration => $license) {
            $expirationDate = new DateTime($expiration);
            if ($this->isExpired($expirationDate) || $this->isSoonExpiring($expirationDate)) {
                $expiringPluginLicenses[] = $this->createPluginInformationStruct($license);
            }
        }

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