ColumnOrder::columnName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace OpenSkill\Datatable\Columns;
4
5
class ColumnOrder
6
{
7
8
    /** @var string */
9
    private $columnName;
10
11
    /** @var bool */
12
    private $isAscOrdering;
13
14
    /**
15
     * ColumnOrder constructor.
16
     * @param string $columnName the internal name of the column
17
     * @param bool $isAscOrdering true if the ordering is ascending
18
     */
19
    public function __construct($columnName, $isAscOrdering)
20
    {
21
        $this->columnName = $columnName;
22
        $this->isAscOrdering = $isAscOrdering;
23
    }
24
25
    /**
26
     * @return string
27
     */
28
    public function columnName()
29
    {
30
        return $this->columnName;
31
    }
32
33
    /**
34
     * @return bool
35
     */
36
    public function isAscending()
37
    {
38
        return $this->isAscOrdering;
39
    }
40
41
    /**
42
     * @return bool
43
     */
44
    public function isDescending()
45
    {
46
        return !$this->isAscOrdering;
47
    }
48
}