Code Duplication    Length = 6-6 lines in 2 locations

src/Alpixel/Bundle/CMSBundle/Controller/FrontNodeController.php 1 location

@@ 27-32 (lines=6) @@
24
        $entityManager = $this->get('doctrine.orm.entity_manager');
25
        $meta = $entityManager->getMetadataFactory()->getAllMetadata();
26
27
        foreach ($meta as $m) {
28
            $relations = $m->getAssociationMappings();
29
            if (array_key_exists('node', $relations) && $relations['node']['targetEntity'] == 'Alpixel\Bundle\CMSBundle\Entity\Node') {
30
                $entities[] = $m;
31
            }
32
        }
33
34
        foreach ($entities as $entity) {
35
            $object = $entityManager

src/Alpixel/Bundle/CMSBundle/Listener/SitemapListener.php 1 location

@@ 30-35 (lines=6) @@
27
            $entityManager = $this->doctrine->getManager();
28
            $meta = $entityManager->getMetadataFactory()->getAllMetadata();
29
30
            foreach ($meta as $m) {
31
                $relations = $m->getAssociationMappings();
32
                if (array_key_exists('node', $relations) && $relations['node']['targetEntity'] == 'Alpixel\Bundle\CMSBundle\Entity\Node') {
33
                    $entities[] = $m;
34
                }
35
            }
36
37
            $pages = [];
38
            foreach ($entities as $entity) {