Code Duplication    Length = 16-16 lines in 2 locations

system/modules/Ui/objects/DataManager.php 2 locations

@@ 258-273 (lines=16) @@
255
        if ($this->joins) {
256
            $queryParams['joins'] = $this->joins;
257
        }
258
        if (!empty($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'])) {
259
            foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) {
260
                if (!empty($colOptions['userCol'])) {
261
                    $queryParams['where'][] = [$colName, \Model::getColValue(\Users\User::$cur, $colOptions['userCol'])];
262
                } elseif (isset($colOptions['value'])) {
263
                    if (is_array($colOptions['value'])) {
264
                        foreach ($colOptions['value'] as $key => $value) {
265
                            if ($key === 'userCol') {
266
                                $colOptions['value'][$key] = \Model::getColValue(\Users\User::$cur, $value);
267
                            }
268
                        }
269
                    }
270
                    $queryParams['where'][] = [$colName, $colOptions['value'], is_array($colOptions['value']) ? 'IN' : '='];
271
                }
272
            }
273
        }
274
        if (!empty($this->managerOptions['filters'])) {
275
            foreach ($this->managerOptions['filters'] as $col) {
276
                $colInfo = $modelName::getColInfo($col);
@@ 558-573 (lines=16) @@
555
        if (!empty($params['categoryPath']) && $modelName::$categoryModel) {
556
            $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE'];
557
        }
558
        if (!empty($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'])) {
559
            foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) {
560
                if (!empty($colOptions['userCol'])) {
561
                    $queryParams['where'][] = [$colName, \Model::getColValue(\Users\User::$cur, $colOptions['userCol'])];
562
                } elseif (isset($colOptions['value'])) {
563
                    if (is_array($colOptions['value'])) {
564
                        foreach ($colOptions['value'] as $key => $value) {
565
                            if ($key === 'userCol') {
566
                                $colOptions['value'][$key] = \Model::getColValue(\Users\User::$cur, $value);
567
                            }
568
                        }
569
                    }
570
                    $queryParams['where'][] = [$colName, $colOptions['value'], is_array($colOptions['value']) ? 'IN' : '='];
571
                }
572
            }
573
        }
574
        $modelName = $this->modelName;
575
        if (!empty($this->managerOptions['filters'])) {
576
            foreach ($this->managerOptions['filters'] as $col) {