protected function addMenuItem(\SimpleXMLElement $item)
    {
        $em            = $this->doctrineHelper->getEntityManager();
        $adminMenuItem = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->identifier]);
        $parent        = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->parent]);
        
        if (null === $adminMenuItem) {
            $adminMenuItem = new AdminMenu();
            $adminMenuItem->setCssClass((string)$item->css_class);
            $adminMenuItem->setIdentifier((string)$item->identifier);
            $adminMenuItem->setName((string)$item->name);
            $adminMenuItem->setRouteName((string)$item->route_name);
            $adminMenuItem->setHierarchy((int)$item->hierarchy);
            $adminMenuItem->setParent($parent);
            
            $em->persist($adminMenuItem);
            $em->flush();
        }
    }
protected function addMenuItem(\SimpleXMLElement $item)
    {
        $em            = $this->doctrineHelper->getEntityManager();
        $adminMenuItem = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->identifier]);
        $parent        = $this->adminMenuRepository->findOneBy(['identifier' => (string)$item->parent]);
        
        if (null === $adminMenuItem) {
            $adminMenuItem = new AdminMenu();
            $adminMenuItem->setCssClass((string)$item->css_class);
            $adminMenuItem->setIdentifier((string)$item->identifier);
            $adminMenuItem->setName((string)$item->name);
            $adminMenuItem->setRouteName((string)$item->route_name);
            $adminMenuItem->setHierarchy((int)$item->hierarchy);
            $adminMenuItem->setParent($parent);
            
            $em->persist($adminMenuItem);
            $em->flush();
        }
    }
protected function addMenuItem ( \ SimpleXMLElement $ item ) { $ em = $ this -> doctrineHelper -> getEntityManager ( ) ; $ adminMenuItem = $ this -> adminMenuRepository -> findOneBy ( [ 'identifier' => ( string ) $ item -> identifier ] ) ; $ parent = $ this -> adminMenuRepository -> findOneBy ( [ 'identifier' => ( string ) $ item -> parent ] ) ; if ( null === $ adminMenuItem ) { $ adminMenuItem = new AdminMenu ( ) ; $ adminMenuItem -> setCssClass ( ( string ) $ item -> css_class ) ; $ adminMenuItem -> setIdentifier ( ( string ) $ item -> identifier ) ; $ adminMenuItem -> setName ( ( string ) $ item -> name ) ; $ adminMenuItem -> setRouteName ( ( string ) $ item -> route_name ) ; $ adminMenuItem -> setHierarchy ( ( int ) $ item -> hierarchy ) ; $ adminMenuItem -> setParent ( $ parent ) ; $ em -> persist ( $ adminMenuItem ) ; $ em -> flush ( ) ; } }
Creates new admin menu item

@param \SimpleXMLElement $item
Creates new admin menu item