Orderable::BOTH()   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\Orderable;
4
5
/**
6
 * Class Orderable
7
 * @package OpenSkill\Datatable\Columns
8
 *
9
 * Class that indicates the option for the orderable property of a column
10
 */
11
abstract class Orderable
12
{
13
    /**
14
     * Will return an orderable configuration that does not allow ordering.
15
     * @return NoneOrderable
16
     */
17
    public static function NONE()
18
    {
19
        return new NoneOrderable();
20
    }
21
22
    /**
23
     * Will return an orderable configuration that does allow ordering but only on asc.
24
     * @return AscOrderable
25
     */
26
    public static function ASC()
27
    {
28
        return new AscOrderable();
29
    }
30
31
    /**
32
     * Will return an orderable configuration that does allow ordering but only on desc.
33
     * @return DescOrderable
34
     */
35
    public static function DESC()
36
    {
37
        return new DescOrderable();
38
    }
39
40
    /**
41
     * Will return an orderable configuration that does allow ordering on both directions.
42
     * @return BothOrderable
43
     */
44
    public static function BOTH()
45
    {
46
        return new BothOrderable();
47
    }
48
49
    /**
50
     * Will determine if the current configuration allows ordering.
51
     * @return bool True if the column can be ordered, false if not.
52
     */
53
    abstract public function isOrderable();
54
}