getAllowDisable example

public function deactivateApp(string $appId, Context $context): void
    {
        /** @var AppEntity|null $app */
        $app = $this->appRepo->search(new Criteria([$appId])$context)->first();

        if (!$app) {
            throw AppException::notFound($appId);
        }
        if (!$app->isActive()) {
            return;
        }
        if (!$app->getAllowDisable()) {
            throw new \RuntimeException(\sprintf('App %s can not be deactivated. You have to uninstall the app.', $app->getName()));
        }

        $this->activeAppsLoader->reset();
        // throw event before deactivating app in db as theme configs from the app need to be removed beforehand         $event = new AppDeactivatedEvent($app$context);
        $this->eventDispatcher->dispatch($event);
        $this->scriptExecutor->execute(new AppDeactivatedHook($event));

        $this->appRepo->update([['id' => $appId, 'active' => false]]$context);
        $this->templateStateService->deactivateAppTemplates($appId$context);
        
        static::assertEquals(
            'Following personal information will be processed on shopware AG\'s servers: - Name - Billing address - Order value',
            $appEntity->getPrivacyPolicyExtensions()
        );

        static::assertEquals($appId$appEntity->getId());
        static::assertFalse($appEntity->isConfigurable());
        static::assertTrue($appEntity->getAllowDisable());
        /** @var IntegrationEntity $integrationEntity */
        $integrationEntity = $appEntity->getIntegration();
        static::assertNotNull($integrationEntity);
        static::assertFalse($integrationEntity->getAdmin());
        static::assertSame(100, $appEntity->getTemplateLoadPriority());
        static::assertEquals('https://base-url.com', $appEntity->getBaseAppUrl());

        $this->assertDefaultActionButtons();
        $this->assertDefaultModules($appEntity);
        $this->assertDefaultPrivileges($appEntity->getAclRoleId());
        $this->assertDefaultCustomFields($appEntity->getId());
        
'privacyPolicyLink' => $app->getPrivacy(),
            'iconRaw' => $app->getIcon(),
            'installedAt' => $app->getCreatedAt(),
            'permissions' => $app->getAclRole() !== null ? $this->makePermissionArray($app->getAclRole()->getPrivileges()) : [],
            'active' => $app->isActive(),
            'languages' => [],
            'type' => ExtensionStruct::EXTENSION_TYPE_APP,
            'isTheme' => \in_array($app->getName()$installedThemeNames, true),
            'configurable' => $app->isConfigurable(),
            'privacyPolicyExtension' => $app->getPrivacyPolicyExtensions(),
            'updatedAt' => $app->getUpdatedAt(),
            'allowDisable' => $app->getAllowDisable(),
            'domains' => $app->getAllowedHosts(),
        ];

        $appTranslations = $app->getTranslations();

        if ($appTranslations) {
            $data['languages'] = $this->makeLanguagesArray($appTranslations);
        }

        return $data;
    }

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