Completed
Push — master ( d0e0e5...0154ba )
by Andrii
05:43 queued 03:12
created

ChargeQuery::withCommonObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
4
namespace hipanel\modules\finance\models\query;
5
6
7
use hiqdev\hiart\ActiveQuery;
8
9
/**
10
 * Class ChargeQuery
11
 * @package hipanel\modules\finance\models\query
12
 */
13
class ChargeQuery extends ActiveQuery
14
{
15
    /**
16
     * @return $this
17
     */
18
    public function withCommonObject(): self
19
    {
20
        $this->joinWith('commonObject');
21
        $this->andWhere(['with_commonObject' => true]);
22
23
        return $this;
24
    }
25
26
    /**
27
     * @return $this
28
     */
29
    public function withLatestCommonObject(): self
30
    {
31
        $this->joinWith('latestCommonObject');
32
        $this->andWhere(['with_latestCommonObject' => true]);
33
34
        return $this;
35
    }
36
}
37