Completed
Push — master ( 3868fa...db4cfd )
by WEBEWEB
01:23
created

DataTablesMapping   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 76
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getAlias() 0 6 3
A getColumn() 0 3 1
A getPrefix() 0 3 1
A setColumn() 0 4 1
A setPrefix() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the jquery-datatables-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
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 WBW\Bundle\JQuery\DatatablesBundle\API;
13
14
/**
15
 * DataTables mapping.
16
 *
17
 * @author webeweb <https://github.com/webeweb/>
18
 * @package WBW\Bundle\JQuery\DatatablesBundle\API
19
 */
20
class DataTablesMapping {
21
22
    /**
23
     * Column.
24
     *
25
     * @var string
26
     */
27
    private $column;
28
29
    /**
30
     * Prefix.
31
     *
32
     * @var string
33
     */
34
    private $prefix;
35
36
    /**
37
     * Constructor.
38
     */
39
    public function __construct() {
40
        // NOTHING TO DO.
41
    }
42
43
    /**
44
     * Get the alias.
45
     *
46
     * @return string Returns the alias.
47
     */
48
    public function getAlias() {
49
        if (null === $this->column) {
50
            return null;
51
        }
52
        return null !== $this->prefix ? implode(".", [$this->prefix, $this->column]) : $this->column;
53
    }
54
55
    /**
56
     * Get the column.
57
     *
58
     * @return string Returns the column.
59
     */
60
    public function getColumn() {
61
        return $this->column;
62
    }
63
64
    /**
65
     * Get the prefix.
66
     *
67
     * @return string Returns the prefix.
68
     */
69
    public function getPrefix() {
70
        return $this->prefix;
71
    }
72
73
    /**
74
     * Set the column.
75
     *
76
     * @param string $column The column.
77
     * @return DataTablesMapping Returns this DataTables mapping.
78
     */
79
    public function setColumn($column) {
80
        $this->column = $column;
81
        return $this;
82
    }
83
84
    /**
85
     * Set the prefix.
86
     *
87
     * @param string $prefix The prefix.
88
     * @return DataTablesMapping Returns this DataTables mapping.
89
     */
90
    public function setPrefix($prefix) {
91
        $this->prefix = $prefix;
92
        return $this;
93
    }
94
95
}
96