cleanupContentTypeEntries example

if (!\is_object($parent)) {
                    throw new InvalidArgumentException(sprintf('Unable to find parent for query %s', print_r($menuItem['parent'], true)));
                }
            }

            $items[] = $this->createMenuItem($menuItem$parent);
        }

        $this->em->flush($items);
        $this->removeNotExistingEntries($contentTypes);
        $this->cleanupContentTypeEntries();
    }

    protected function createMenuItem(array $menuItem, ?Menu $parent = null): Menu
    {
        $item = null;

        /** @var Menu $item */
        $item = $this->menuRepository->findOneBy([
            'contentType' => $menuItem['contentType'],
            'label' => $menuItem['name'],
        ]);

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