RewriteTable example

public function refreshSeoIndex()
    {
        list($cachedTime$elementId$shopId) = $this->getCachedTime();

        $cache = (int) Shopware()->Config()->get('routerCache');
        $cache = $cache < 360 ? 86400 : $cache;
        $currentTime = date('Y-m-d H:i:s');

        if (strtotime($cachedTime) < time() - $cache) {
            $this->setCachedTime($currentTime$elementId$shopId);

            $resultTime = Shopware()->Modules()->RewriteTable()->sCreateRewriteTable($cachedTime);
            if ($resultTime === $cachedTime) {
                $resultTime = $currentTime;
            }
            if ($resultTime !== $currentTime) {
                $this->setCachedTime($resultTime$elementId$shopId);
            }
        }
    }

    /** * Read the exact time of the last SEO url update. Will also return elementId and shopId * in order to be able to update that option later * * todo@dn: Taken from RouterRewrite plugin - clean up * * @return array */
 $viewport->getEndCol();
        }

        $identifier .= $el->getStartCol() . $el->getStartRow() . $el->getEndCol() . $el->getEndRow();

        return $identifier;
    }

    private function generateEmotionSeoUrls(Emotion $emotion): void
    {
        $seoIndexer = Shopware()->Container()->get('seoindex');
        $module = Shopware()->Modules()->RewriteTable();
        $shops = $emotion->getShops();
        $emotionData = [
            'id' => $emotion->getId(),
            'name' => $emotion->getName(),
        ];

        $translator = $this->getTranslation();
        $routerCampaignTemplate = Shopware()->Config()->get('routerCampaignTemplate');

        foreach ($shops as $shop) {
            $seoIndexer->registerShop($shop->getId());
            
/** * @deprecated in 5.6, will be private in the future * * Helper function to get the sRewriteTable class with auto completion. * * @return sRewriteTable */
    public function RewriteTable()
    {
        trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.7.', __CLASS__, __METHOD__), E_USER_DEPRECATED);

        return Shopware()->Modules()->RewriteTable();
    }

    /** * Clean up seo links. remove links of non-existing categories, articles... */
    public function initSeoAction()
    {
        $shopId = (int) $this->Request()->getParam('shopId', 1);

        @set_time_limit(1200);

        
'link' => 'http://www.shopware.de/',
        ];
    }

    /** * Helper function to get access on the sRewriteTable component. * * @return sRewriteTable */
    public function RewriteTable()
    {
        return Shopware()->Modules()->RewriteTable();
    }

    /** * Helper function to get access on the SeoIndex component. * * @return Shopware_Components_SeoIndex */
    public function SeoIndex()
    {
        return Shopware()->Container()->get('seoindex');
    }

    

        $this->synchronizerService->sync(true);
        $this->cacheManager->clearConfigCache();
        $this->cacheManager->clearProxyCache();
    }

    private function createUrls(Type $type): void
    {
        $shops = $this->getModelManager()->getRepository(Shop::class)->getActiveShopsFixed();
        $seoIndexer = $this->get('seoindex');

        $rewriteTable = $this->get('modules')->RewriteTable();

        foreach ($shops as $shop) {
            $seoIndexer->registerShop($shop->getId());

            $rewriteTable->baseSetup();
            $rewriteTable->createSingleContentTypeUrl($type);
        }
    }

    /** * @return list<array{name: string, url: string}> */
/** * {@inheritdoc} * * @throws Exception */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->database = $this->container->get(Connection::class);
        $this->modules = $this->container->get('modules');
        $this->modelManager = $this->container->get(ModelManager::class);
        $this->seoIndex = $this->container->get('seoindex');
        $this->rewriteTable = $this->modules->RewriteTable();
        $this->events = $this->container->get('events');

        $shops = null;

        if ($input->getArgument('shopId')) {
            $io = new SymfonyStyle($input$output);
            $io->warning('Argument "shopId" will be replaced by option "--shopId" in the next major version');
            $shops = $input->getArgument('shopId');
        } elseif ($input->getOption('shopId')) {
            $shops = $input->getOption('shopId');
        }

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