internalSetPath example


        $parentId = $category->getParent()->getId();

        $parents = $this->getCategoryComponent()->getParentCategoryIds($parentId);
        $path = implode('|', $parents);
        if (empty($path)) {
            $path = '';
        } else {
            $path = '|' . $path . '|';
        }

        $category->internalSetPath($path);

        return $category;
    }

    /** * @param int $articleId * @param int $categoryId */
    public function backlogRemoveAssignment($articleId$categoryId)
    {
        $this->getCategoryComponent()->removeAssignment($articleId$categoryId);
    }
$item->setParent($parent);

            $parents = $this->getCategoryComponent()->getParentCategoryIds($parentId);

            $path = implode('|', $parents);
            if (empty($path)) {
                $path = null;
            } else {
                $path = '|' . $path . '|';
            }

            $item->internalSetPath($path);

            $batchModeEnabled = Shopware()->Config()->get('moveBatchModeEnabled');

            if ($item->isLeaf() || !$batchModeEnabled) {
                $needsRebuild = false;
            } else {
                Shopware()->Container()->get(Shopware\Components\Model\CategorySubscriber::class)->disableForNextFlush();
                $needsRebuild = true;
            }

            $this->em->flush($item);
        }
Home | Imprint | This part of the site doesn't use cookies.