<commit_before><?php

namespace {{ namespace }}\Helper\Menu;

use Doctrine\ORM\EntityManager;
use Kunstmaan\AdminBundle\Helper\Menu\MenuAdaptorInterface;
use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder;
use Kunstmaan\AdminBundle\Helper\Menu\MenuItem;
use Kunstmaan\AdminBundle\Helper\Menu\TopMenuItem;
use Symfony\Component\HttpFoundation\Request;

class {{ entity_class }}MenuAdaptor implements MenuAdaptorInterface
{
    private $overviewpageIds = array();

    /**
     * @param EntityManager $em The entity manager
     */
    public function __construct(EntityManager $em)
    {
	$overviewPageNodes = $em->getRepository('KunstmaanNodeBundle:Node')->findByRefEntityName('{{ namespace|replace({"\\": "\\\\"}) }}\\Entity\\Pages\\{{ entity_class }}OverviewPage');
        foreach ($overviewPageNodes as $overviewPageNode) {
            $this->overviewpageIds[] = $overviewPageNode->getId();
        }
    }

    public function adaptChildren(MenuBuilder $menu, array &$children, MenuItem $parent = null, Request $request = null)
    {
        if (!is_null($parent) && 'KunstmaanAdminBundle_modules' == $parent->getRoute()) {
            // Page
            $menuItem = new TopMenuItem($menu);
            $menuItem
		->setRoute('{{ bundle.getName()|lower }}_admin_pages_{{ entity_class|lower }}page')<commit_msg>[GeneratorBundle]: update menuadaptor to correct syntax<commit_after><?php

namespace {{ namespace }}\Helper\Menu;

use Doctrine\ORM\EntityManager;
use Kunstmaan\AdminBundle\Helper\Menu\MenuAdaptorInterface;
use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder;
use Kunstmaan\AdminBundle\Helper\Menu\MenuItem;
use Kunstmaan\AdminBundle\Helper\Menu\TopMenuItem;
use Symfony\Component\HttpFoundation\Request;

class {{ entity_class }}MenuAdaptor implements MenuAdaptorInterface
{
    private $overviewpageIds = null;

    private $em;

    /**
     * @param EntityManager $em The entity manager
     */
    public function __construct(EntityManager $em)
    {
	    $this->em = $em;
    }

    public function adaptChildren(MenuBuilder $menu, array &$children, MenuItem $parent = null, Request $request = null)
    {
        if (is_null($this->overviewpageIds)) {
            $overviewPageNodes = $this->em->getRepository('KunstmaanNodeBundle:Node')->findByRefEntityName('{{ namespace|replace({"\\": "\\\\"}) }}\\Entity\\Pages\\{{ entity_class }}OverviewPage');
            $this->overviewpageIds = array();
            foreach ($overviewPageNodes as $overviewPageNode) {
                $this->overviewpageIds[] = $overviewPageNode->getId();
            }
        }

        if (!is_null($parent) && 'KunstmaanAdminBundle_modules' == $parent->getRoute()) {
            // Page
            $menuItem = new TopMenuItem($menu);
            $menuItem
		->setRoute('{{ bundle.getName()|lower }}_admin_pages_{{ entity_class|lower }}page')
{'fraction_non_alphanumeric': 0.14039408866995073, 'fraction_numerical': 0.0, 'mean_word_length': 3.754180602006689, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2895314', 'n_tokens_mistral': 835, 'n_tokens_neox': 814, 'n_words': 156}