Completed
Push — master ( 2c73cd...c2d895 )
by WEBEWEB
01:29
created

DataTablesMapping   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 10
lcom 1
cbo 0
dl 0
loc 88
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getAlias() 0 6 3
A getColumn() 0 3 1
A getParent() 0 3 1
A getPrefix() 0 3 1
A setColumn() 0 4 1
A setParent() 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 implements DataTablesMappingInterface {
21
22
    /**
23
     * Column.
24
     *
25
     * @var string
26
     */
27
    private $column;
28
29
    /**
30
     * Parent.
31
     *
32
     * @var DataTablesColumnInterface
33
     */
34
    private $parent;
35
36
    /**
37
     * Prefix.
38
     *
39
     * @var string
40
     */
41
    private $prefix;
42
43
    /**
44
     * Constructor.
45
     */
46
    public function __construct() {
47
        // NOTHING TO DO.
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function getAlias() {
54
        if (null === $this->column) {
55
            return null;
56
        }
57
        return null !== $this->prefix ? implode(".", [$this->prefix, $this->column]) : $this->column;
58
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63
    public function getColumn() {
64
        return $this->column;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function getParent() {
71
        return $this->parent;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getPrefix() {
78
        return $this->prefix;
79
    }
80
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function setColumn($column) {
85
        $this->column = $column;
86
        return $this;
87
    }
88
89
    /**
90
     * Set the parent.
91
     *
92
     * @param DataTablesColumnInterface $parent The parent.
93
     * @return DataTablesMappingInterface Returns this mapping.
94
     */
95
    public function setParent(DataTablesColumnInterface $parent) {
96
        $this->parent = $parent;
97
        return $this;
98
    }
99
100
    /**
101
     * {@inheritdoc}
102
     */
103
    public function setPrefix($prefix) {
104
        $this->prefix = $prefix;
105
        return $this;
106
    }
107
}
108