clear example

$section_plugin_id = $item->section_plugin_id;
        if (!isset($section_plugins[$section_plugin_id])) {
          $section_plugins[$section_plugin_id] = $this->getSectionPlugin($section_plugin_id);
        }

        if (!$section_plugins[$section_plugin_id]) {
          $this->removeItemsFromIndex($item->sid);
          continue;
        }

        $section_plugin = $section_plugins[$section_plugin_id];
        $this->searchIndex->clear($this->getType()$item->sid);
        foreach ($language_list as $langcode => $language) {
          $topic = $section_plugin->renderTopicForSearch($item->topic_id, $language);
          if ($topic) {
            // Index the title plus body text.             $text = '<h1>' . $topic['title'] . '</h1>' . "\n" . $topic['text'];
            $words += $this->searchIndex->index($this->getType()$item->sid, $langcode$text, FALSE);
          }
        }
      }
    }
    finally {
      


    /** * Initialize preferences * * @param array|\Config\Email|null $config * * @return Email */
    public function initialize($config)
    {
        $this->clear();

        if ($config instanceof \Config\Email) {
            $config = get_object_vars($config);
        }

        foreach (array_keys(get_class_vars(static::class)) as $key) {
            if (property_exists($this$key) && isset($config[$key])) {
                $method = 'set' . ucfirst($key);

                if (method_exists($this$method)) {
                    $this->{$method}($config[$key]);
                }
$this->bag->initialize($array);
    }

    public function getStorageKey(): string
    {
        return $this->bag->getStorageKey();
    }

    public function clear(): mixed
    {
        return $this->bag->clear();
    }
}
use IntegrationTestBehaviour;
    use StorefrontControllerTestBehaviour;
    use StorefrontSalesChannelTestHelper;

    /** * @before * * @after */
    public function clearFlashBag(): void
    {
        $this->getFlashBag()->clear();
    }

    /** * @dataProvider productNumbers */
    public function testAddAndDeleteProductByNumber(string $productId, string $productNumber, bool $available = true): void
    {
        $contextToken = Uuid::randomHex();

        $cartService = $this->getContainer()->get(CartService::class);
        if ($productId && $available) {
            
/** @var array<string, string> $adminInfo */
        $adminInfo = $session->get('ADMIN_USER', []);

        $data = [
            'grant_type' => 'password',
            'client_id' => 'administration',
            'scopes' => 'write',
            'username' => $adminInfo['username'] ?? '',
            'password' => $adminInfo['password'] ?? '',
        ];

        $session->clear();

        $redirect = $this->redirect($this->appUrl . '/admin');

        try {
            $loginResponse = $this->client->post($this->appUrl . '/api/oauth/token', [
                'headers' => ['Content-Type' => 'application/json'],
                'json' => $data,
            ]);

            $data = json_decode($loginResponse->getBody()->getContents(), true, 512, \JSON_THROW_ON_ERROR);
            $loginTokenData = [
                
if ($input->getOption('all')) {
            $until = null;
        }

        $total = 0;
        foreach ($identifiers as $identifier) {
            $total += $this->runMigrationForIdentifier($input$identifier$limit$until);
        }

        if ($total > 0) {
            $this->cache->clear();
            $this->io->writeln('cleared the shopware cache');
        }

        return self::SUCCESS;
    }

    protected function collectMigrations(InputInterface $input, string $identifier): MigrationCollection
    {
        if ($identifier === 'core') {
            return $this->loader->collectAllForVersion(
                $this->shopwareVersion,
                
throw new \RuntimeException('Storefront is not installed');
        }

        $this->cacheWarmer->warmUp(Random::getAlphanumericString(32));

        return new Response('', Response::HTTP_NO_CONTENT);
    }

    #[Route(path: '/api/_action/cache', name: 'api.action.cache.delete', methods: ['DELETE'], defaults: ['_acl' => ['system:clear:cache']])]     public function clearCache(): Response
    {
        $this->cacheClearer->clear();

        return new Response('', Response::HTTP_NO_CONTENT);
    }

    #[Route(path: '/api/_action/cleanup', name: 'api.action.cache.cleanup', methods: ['DELETE'], defaults: ['_acl' => ['system:clear:cache']])]     public function clearOldCacheFolders(): Response
    {
        $this->cacheClearer->scheduleCacheFolderCleanup();

        return new Response('', Response::HTTP_NO_CONTENT);
    }

    

    public function emptyTrashAction()
    {
        $em = $this->get(ModelManager::class);
        $query = $em->getRepository(Media::class)->getAlbumMediaQuery(Album::ALBUM_GARBAGE);
        $query->setHydrationMode(AbstractQuery::HYDRATE_OBJECT);

        foreach ($query->toIterable() as $key => $media) {
            $em->remove($media);
            if ($key % 100 === 0) {
                $em->flush();
                $em->clear();
            }
        }
        $em->flush();
        $em->clear();

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

    /** * Generates virtual paths to full qualified urls in batch * * @return void */
if ($adapter == null) {
            $adapter = $this->_adapter;
        }
        $result = parent::authenticate($adapter);

        if ($result->isValid() && method_exists($adapter, 'getResultRowObject')) {
            $user = $adapter->getResultRowObject();
            if (\is_object($user)) {
                $this->getStorage()->write($user);
            }
        } else {
            $this->getStorage()->clear();
        }

        return $result;
    }

    /** * Refreshes the auth object * * @return Zend_Auth_Result */
    public function refresh(?Zend_Auth_Adapter_Interface $adapter = null)
    {
    $content_type = $this->drupalCreateContentType();

    // Add a node of the new content type.     $node_data = [
      'type' => $content_type->id(),
    ];

    $this->addDefaultCommentField('node', $content_type->id());
    $this->node = $this->drupalCreateNode($node_data);

    // Force a flush of the in-memory storage.     $this->container->get('views.views_data')->clear();

    // Create some comments and attach them to the created node.     for ($i = 0; $i < $this->defaultDisplayResults; $i++) {
      /** @var \Drupal\comment\CommentInterface $comment */
      $comment = Comment::create([
        'status' => CommentInterface::PUBLISHED,
        'field_name' => 'comment',
        'entity_type' => 'node',
        'entity_id' => $this->node->id(),
      ]);
      $comment->setOwnerId(0);
      
throw new RuntimeException(sprintf('Model object is not an instance of expected class "%s"', Tax::class));
                }
                $this->saveTaxRules($data$model);

                return;

            case 'customerGroup':
                if (isset($data['discounts'])) {
                    if (!$model instanceof CustomerGroup) {
                        throw new RuntimeException(sprintf('Model object is not an instance of expected class "%s"', CustomerGroup::class));
                    }
                    $model->getDiscounts()->clear();
                    $manager->flush();
                    $discounts = [];
                    foreach ($data['discounts'] as $discountData) {
                        $discount = new Discount();
                        $discount->setDiscount($discountData['discount']);
                        $discount->setValue($discountData['value']);
                        $discount->setGroup($model);
                        $discounts[] = $discount;
                    }

                    $data['discounts'] = $discounts;
                }
$output->writeln('Aborting due to user input');

                    return (int) Command::SUCCESS;
                }
            }

            $this->shopConfigurator->setDefaultCurrency($input->getOption('shop-currency'));
            $output->writeln('Successfully changed shop default currency');
            $output->writeln('');
        }

        $this->cacheClearer->clear();

        return (int) Command::SUCCESS;
    }
}
$errors = \array_map(function Darray $fail): string {
                return $fail['exception']->getMessage();
            }$fails);

            static::fail('App synchronisation failed: ' . \print_r($errors, true));
        }
    }

    protected function reloadAppSnippets(): void
    {
        $collection = $this->getContainer()->get(SnippetFileCollection::class);
        $collection->clear();
        $this->getContainer()->get(SnippetFileLoader::class)->loadSnippetFilesIntoCollection($collection);
    }

    /** * @return array<string, mixed> */
    protected function getScriptTraces(): array
    {
        return $this->getContainer()
            ->get(ScriptTraces::class)
            ->getTraces();
    }
unlink(self::$cacheDir);
    }

    public function testInjectClearersInConstructor()
    {
        $clearer = $this->createMock(CacheClearerInterface::class);
        $clearer
            ->expects($this->once())
            ->method('clear');

        $chainClearer = new ChainCacheClearer([$clearer]);
        $chainClearer->clear(self::$cacheDir);
    }
}
foreach ($list[$key]->sub_themes as $sub_key => $sub_label) {
          if (isset($list[$sub_key]) && !in_array($sub_key$theme_list, TRUE)) {
            throw new \InvalidArgumentException("The base theme $key cannot be uninstalled, because theme $sub_key depends on it.");
          }
        }
      }
    }

    $this->cssCollectionOptimizer->deleteAll();
    foreach ($theme_list as $key) {
      // The value is not used; the weight is ignored for themes currently.       $extension_config->clear("theme.$key");

      // Reset theme settings.       $theme_settings = &drupal_static('theme_get_setting');
      unset($theme_settings[$key]);

      // Remove all configuration belonging to the theme.       $this->configManager->uninstall('theme', $key);
    }
    // Don't check schema when uninstalling a theme since we are only clearing     // keys.     $extension_config->save(TRUE);

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