getArticleId example



    private function getBacklog(object $entity): ?Backlog
    {
        switch (true) {
            // Article changes             case $entity instanceof Article:
                return new Backlog(Article::class$entity->getId());

                // Variant changes             case $entity instanceof Price:
                return new Backlog(Article::class$entity->getDetail()->getArticleId());
            case $entity instanceof Variant:
                return new Backlog(Article::class$entity->getArticleId());

                // Order changes             case $entity instanceof Order:
                return new Backlog(Order::class$entity->getId());
            case $entity instanceof Detail:
                return new Backlog(Order::class$entity->getOrder()->getId());
            case $entity instanceof Billing:
                return new Backlog(Order::class$entity->getOrder()->getId());
            case $entity instanceof Shipping:
                
switch ($entityName) {
            case Shopware\Models\Article\Price::class:
                $cacheIds[] = 'a' . $entity->getArticle()->getId();
                break;

            case Shopware\Models\Article\Article::class:
                $cacheIds[] = 'a' . $entity->getId();
                break;

            case Shopware\Models\Article\Detail::class:
                $cacheIds[] = 'a' . $entity->getArticleId();
                break;

            case Shopware\Models\Category\Category::class:
                $cacheIds[] = 'c' . $entity->getId();
                break;

            case Shopware\Models\Blog\Blog::class:
            case Shopware\Models\Banner\Banner::class:
                $cacheIds[] = 'c' . $entity->getCategoryId();
                break;

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