Code Duplication    Length = 21-21 lines in 2 locations

src/Controller/Admin/Shop/Itemadmin.php 1 location

@@ 434-454 (lines=21) @@
431
     * @param string $iGID
432
     * @return mixed
433
     */
434
    private function getItemgroups($iGID = '') // this function should be outsourced, a duplicate is used in admin itemgroups!
435
    {
436
        $querybuilder = $this->dbal->createQueryBuilder();
437
        $querybuilder
438
            ->select('*')
439
            ->from('itemgroups_base', 'b')
440
            ->leftJoin('b', 'itemgroups_text', 't', 'b.itmg_id = t.itmgt_pid AND t.itmgt_lang = ?')
441
            ->setParameter(0, $this->config->getLang())
442
            ->orderBy('itmg_no')
443
        ;
444
445
        if ($iGID != '') {
446
            $querybuilder
447
                ->where('itmg_id = :gid')
448
                ->setParameter(1, $iGID)
449
            ;
450
        }
451
        $stmt = $querybuilder->execute();
452
453
        return $stmt->fetchAll();
454
    }
455
}
456

src/Controller/Admin/Shop/Itemgroupadmin.php 1 location

@@ 280-300 (lines=21) @@
277
     * @param string $iGID
278
     * @return mixed
279
     */
280
    private function getItemgroups($iGID = '')
281
    {
282
        $querybuilder = $this->dbal->createQueryBuilder();
283
        $querybuilder
284
            ->select('*')
285
            ->from('itemgroups_base', 'b')
286
            ->leftJoin('b', 'itemgroups_text', 't', 'b.itmg_id = t.itmgt_pid AND t.itmgt_lang = ?')
287
            ->setParameter(0, $this->config->getLang())
288
            ->orderBy('itmg_no')
289
        ;
290
291
        if ($iGID != '') {
292
            $querybuilder
293
                ->where('itmg_id = ?')
294
                ->setParameter(1, $iGID)
295
            ;
296
        }
297
        $stmt = $querybuilder->execute();
298
299
        return $stmt->fetchAll();
300
    }
301
302
    /**
303
     * @param $aGroups