rebuildAllAssignments example

// Get total number of assignments to build         $output->write('Counting…');
        $count = $component->rebuildAllAssignmentsCount();
        $output->writeln("\rCounted {$count} items");

        $progressHelper = new ProgressBar($output$count);
        $progressHelper->setFormat(' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%');

        // create the assignments         while ($progress < $count) {
            $component->rebuildAllAssignments($limit$progress);
            $progress += $limit;
            $progressHelper->advance();
        }
        $progressHelper->finish();

        $output->writeln("\nDone");

        return 0;
    }
}

        $offset = (int) $this->Request()->getParam('offset', 0);
        $limit = (int) $this->Request()->getParam('limit');

        $component = Shopware()->Container()->get('categorydenormalization');

        if ($offset === 0) {
            $component->rebuildCategoryPath();
            $component->removeAllAssignments();
        }

        $count = $component->rebuildAllAssignments($limit$offset);

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

    public function prepareTreeAction()
    {
        $component = Shopware()->Container()->get('categorydenormalization');

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