AbstractGridColumn   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 16
dl 0
loc 68
rs 10
c 2
b 1
f 0
wmc 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A getOrder() 0 3 1
A getOptions() 0 3 1
A setField() 0 3 1
A getField() 0 3 1
A getLabel() 0 3 1
A setOption() 0 3 1
A setOptions() 0 3 1
A setLabel() 0 3 1
A getOption() 0 7 2
1
<?php
2
3
namespace Dtc\GridBundle\Grid\Column;
4
5
use Dtc\GridBundle\Grid\Source\GridSourceInterface;
6
7
/**
8
 * Standard options.
9
 */
10
abstract class AbstractGridColumn
11
{
12
    protected $field;
13
    protected $label;
14
    protected $options = [];
15
    protected $order;
16
17
    abstract public function format($object, GridSourceInterface $gridsource);
18
19
    public function setOption($key, $value)
20
    {
21
        $this->options[$key] = $value;
22
    }
23
24
    public function getOption($key)
25
    {
26
        if (isset($this->options[$key])) {
27
            return $this->options[$key];
28
        }
29
30
        return null;
31
    }
32
33
    public function getOrder()
34
    {
35
        return $this->order;
36
    }
37
38
    public function setOptions(array $options)
39
    {
40
        $this->options = $options;
41
    }
42
43
    public function getOptions()
44
    {
45
        return $this->options;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getField()
52
    {
53
        return $this->field;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getLabel()
60
    {
61
        return $this->label;
62
    }
63
64
    /**
65
     * @param string $field
66
     */
67
    public function setField($field)
68
    {
69
        $this->field = $field;
70
    }
71
72
    /**
73
     * @param string $label
74
     */
75
    public function setLabel($label)
76
    {
77
        $this->label = $label;
78
    }
79
}
80