Completed
Push — master ( e918d3...e1c7ce )
by Andrii
01:58
created

CustomerQuery   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 25
ccs 0
cts 10
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A attributesMap() 0 11 1
A initFrom() 0 5 1
1
<?php
2
3
namespace hiqdev\billing\hiapi\query;
4
5
use hiqdev\billing\hiapi\models\Customer;
6
7
class CustomerQuery extends \hiapi\query\Query
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $modelClass = Customer::class;
13
14
    protected function attributesMap()
15
    {
16
        return [
17
            'id' => 'zc.obj_id',
18
            'login' => 'zc.login',
19
            'seller' => [
20
                'id' => 'cr.obj_id',
21
                'login' => 'cr.login',
22
            ]
23
        ];
24
    }
25
26
    public function initFrom()
27
    {
28
        return $this->from('zclient zc')
29
            ->leftJoin('zclient     cr', 'cr.obj_id = zc.seller_id');
30
    }
31
}
32