Completed
Push — master ( fd0133...375486 )
by Beniamin
02:35
created

GroupByClauseTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 48
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A addGroupBy() 0 6 1
A getGroupByClauses() 0 4 1
A isGroupByWithRollUp() 0 4 1
A setGroupByWithRollUp() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of Phuria SQL Builder package.
5
 *
6
 * Copyright (c) 2016 Beniamin Jonatan Šimko
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Phuria\SQLBuilder\QueryBuilder\Clause;
13
14
/**
15
 * @author Beniamin Jonatan Šimko <[email protected]>
16
 */
17
trait GroupByClauseTrait
18
{
19
    /**
20
     * @var bool
21
     */
22
    private $groupByWithRollUp = false;
23
24
    /**
25
     * @var array
26
     */
27
    private $groupByClauses = [];
28
29
    /**
30
     * @param string $clause
31
     *
32
     * @return $this
33
     */
34
    public function addGroupBy($clause)
35
    {
36
        $this->groupByClauses[] = $clause;
37
38
        return $this;
39
    }
40
41
    /**
42
     * @return array
43
     */
44
    public function getGroupByClauses()
45
    {
46
        return $this->groupByClauses;
47
    }
48
49
    /**
50
     * @return boolean
51
     */
52
    public function isGroupByWithRollUp()
53
    {
54
        return $this->groupByWithRollUp;
55
    }
56
57
    /**
58
     * @param boolean $groupByWithRollUp
59
     */
60
    public function setGroupByWithRollUp($groupByWithRollUp)
61
    {
62
        $this->groupByWithRollUp = $groupByWithRollUp;
63
    }
64
}