Completed
Push — master ( 064006...20444a )
by WEBEWEB
04:40
created

DataTablesMapping::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
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