Code Duplication    Length = 8-10 lines in 3 locations

src/plan/PriceQuery.php 1 location

@@ 50-59 (lines=10) @@
47
        ];
48
    }
49
50
    public function initFrom()
51
    {
52
        return $this
53
            ->from('uprice              zp')
54
            ->leftJoin('zref            rt', 'rt.obj_id = zp.type_id')
55
            ->leftJoin('zref            tu', 'tu.obj_id = zp.unit_id')
56
            ->leftJoin('zref            cu', 'cu.obj_id = zp.currency_id')
57
            ->leftJoin('obj             zo', 'zo.obj_id = zp.object_id')
58
            ->leftJoin('zref            oc', 'oc.obj_id = zo.class_id');
59
    }
60
}
61

src/target/TargetQuery.php 1 location

@@ 33-40 (lines=8) @@
30
        ];
31
    }
32
33
    public function initFrom()
34
    {
35
        return $this->from('obj   o')
36
                ->leftJoin('zref   t',  't.obj_id  = o.class_id')
37
                ->leftJoin('device d',  'd.obj_id  = o.obj_id')
38
                ->leftJoin('tariff tr', 'tr.obj_id = o.obj_id')
39
                ->leftJoin('zref   tt', 'tt.obj_id = coalesce(d.type_id, tr.type_id)');
40
    }
41
}
42

src/sale/SaleQuery.php 1 location

@@ 49-57 (lines=9) @@
46
        ];
47
    }
48
49
    public function initFrom()
50
    {
51
        return $this->from('zsale   zs')
52
            ->leftJoin('obj         so', 'so.obj_id = zs.object_id')
53
            ->leftJoin('zref        oc', 'oc.obj_id = so.class_id')
54
            ->leftJoin('ztariff     zt', 'zt.obj_id = zs.tariff_id')
55
            ->leftJoin('zclient     zc', 'zc.obj_id = zs.buyer_id')
56
            ->leftJoin('zclient     cr', 'cr.obj_id = zc.seller_id');
57
    }
58
}
59