Completed
Push — master ( 490edd...989494 )
by Kamil
49:24 queued 30:26
created

Filter::getTemplate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
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 Sylius\Component\Grid\Definition;
13
14
/**
15
 * @author Paweł Jędrzejewski <[email protected]>
16
 */
17
class Filter
0 ignored issues
show
Coding Style introduced by
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
18
{
19
    /**
20
     * @var string
21
     */
22
    private $name;
23
24
    /**
25
     * @var string
26
     */
27
    private $type;
28
29
    /**
30
     * @var string
31
     */
32
    private $label;
33
34
    /**
35
     * @var string
36
     */
37
    private $template;
38
39
    /**
40
     * @var array
41
     */
42
    private $options = [];
43
44
    /**
45
     * @param string $name
46
     * @param string $type
47
     */
48
    private function __construct($name, $type)
49
    {
50
        $this->name = $name;
51
        $this->type = $type;
52
53
        $this->label = $name;
54
    }
55
56
    /**
57
     * @param string $name
58
     * @param string $type
59
     *
60
     * @return self
61
     */
62
    public static function fromNameAndType($name, $type)
63
    {
64
        return new self($name, $type);
65
    }
66
67
    /**
68
     * @return string
69
     */
70
    public function getName()
71
    {
72
        return $this->name;
73
    }
74
75
    /**
76
     * @return string
77
     */
78
    public function getType()
79
    {
80
        return $this->type;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getLabel()
87
    {
88
        return $this->label;
89
    }
90
91
    /**
92
     * @param string $label
93
     */
94
    public function setLabel($label)
95
    {
96
        $this->label = $label;
97
    }
98
99
    /**
100
     * @return string
101
     */
102
    public function getTemplate()
103
    {
104
        return $this->template;
105
    }
106
107
    /**
108
     * @param string $template
109
     */
110
    public function setTemplate($template)
111
    {
112
        $this->template = $template;
113
    }
114
115
    /**
116
     * @return array
117
     */
118
    public function getOptions()
119
    {
120
        return $this->options;
121
    }
122
123
    /**
124
     * @param array $options
125
     */
126
    public function setOptions($options)
127
    {
128
        $this->options = $options;
129
    }
130
}
131