Code Duplication    Length = 4-4 lines in 2 locations

src/Kunstmaan/PagePartBundle/Repository/PagePartRefRepository.php 1 location

@@ 91-94 (lines=4) @@
88
89
        // Fetch all the pageparts (only one query per pagepart type)
90
        $pageparts = array();
91
        foreach ($types as $classname => $ids) {
92
            $result = $this->getEntityManager()->getRepository($classname)->findBy(array('id' => $ids));
93
            $pageparts = array_merge($pageparts, $result);
94
        }
95
96
        // Order the pageparts
97
        usort($pageparts, function (EntityInterface $a, EntityInterface $b) use ($order) {

src/Kunstmaan/PagePartBundle/PagePartAdmin/PagePartAdmin.php 1 location

@@ 115-118 (lines=4) @@
112
        // Fetch all the pageparts (only one query per pagepart type)
113
        /** @var EntityInterface[] $pageParts */
114
        $pageParts = array();
115
        foreach ($types as $classname => $ids) {
116
            $result = $this->em->getRepository($classname)->findBy(array('id' => $ids));
117
            $pageParts = array_merge($pageParts, $result);
118
        }
119
120
        // Link the pagepartref to the pagepart
121
        foreach ($this->pagePartRefs as $pagePartRef) {