Completed
Push — master ( a682ba...4851b3 )
by Paweł
40:50
created

RouteTrait::getCacheTimeInSeconds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Content Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\ContentBundle\Model;
16
17
trait RouteTrait
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $templateName;
23
24
    /**
25
     * @var string
26
     */
27
    protected $articlesTemplateName;
28
29
    /**
30
     * @var string
31
     */
32
    protected $type;
33
34
    /**
35
     * @var int
36
     */
37
    protected $cacheTimeInSeconds = 0;
38
39
    /**
40
     * @var string
41
     */
42
    protected $name;
43
44
    /**
45
     * @var string
46
     */
47
    protected $variablePattern;
48
49
    /**
50
     * @var string
51
     */
52
    protected $staticPrefix;
53
54
    /**
55
     * @var int
56
     */
57
    protected $position;
58
59
    /**
60
     * @return string
61
     */
62 50
    public function getName()
63
    {
64 50
        return $this->name;
65
    }
66
67
    /**
68
     * Rename a route by setting its new name.
69
     *
70
     * @param string $name the new name
71
     *
72
     * @return self
73
     */
74 103
    public function setName($name)
75
    {
76 103
        $this->name = $name;
77
78 103
        return $this;
79
    }
80
81
    /**
82
     * @return string
83
     */
84 26
    public function getVariablePattern()
85
    {
86 26
        return $this->variablePattern;
87
    }
88
89
    /**
90
     * @param string $variablePattern
91
     */
92 48
    public function setVariablePattern($variablePattern)
93
    {
94 48
        $this->variablePattern = $variablePattern;
95 48
    }
96
97
    /**
98
     * {@inheritdoc}
99
     */
100 40
    public function getTemplateName()
101
    {
102 40
        return $this->templateName;
103
    }
104
105
    /**
106
     * {@inheritdoc}
107
     */
108 10
    public function setTemplateName($templateName)
109
    {
110 10
        $this->templateName = $templateName;
111 10
    }
112
113
    /**
114
     * {@inheritdoc}
115
     */
116 30
    public function getArticlesTemplateName()
117
    {
118 30
        return $this->articlesTemplateName;
119
    }
120
121
    /**
122
     * {@inheritdoc}
123
     */
124 7
    public function setArticlesTemplateName($articlesTemplateName)
125
    {
126 7
        $this->articlesTemplateName = $articlesTemplateName;
127 7
    }
128
129
    /**
130
     * {@inheritdoc}
131
     */
132 50
    public function getType()
133
    {
134 50
        return $this->type;
135
    }
136
137
    /**
138
     * {@inheritdoc}
139
     */
140 103
    public function setType($type)
141
    {
142 103
        $this->type = $type;
143 103
    }
144
145
    /**
146
     * @return int
147
     */
148 33
    public function getCacheTimeInSeconds()
149
    {
150 33
        return $this->cacheTimeInSeconds;
151
    }
152
153
    /**
154
     * @param int $cacheTimeInSeconds
155
     */
156 7
    public function setCacheTimeInSeconds($cacheTimeInSeconds)
157
    {
158 7
        $this->cacheTimeInSeconds = $cacheTimeInSeconds;
159 7
    }
160
161
    /**
162
     * @return string
163
     */
164 27
    public function getStaticPrefix()
165
    {
166 27
        return $this->staticPrefix;
167
    }
168
169
    /**
170
     * @param string $staticPrefix
171
     */
172 48
    public function setStaticPrefix($staticPrefix)
173
    {
174 48
        $this->staticPrefix = $staticPrefix;
175 48
    }
176
177
    /**
178
     * @return int
179
     */
180
    public function getPosition()
181
    {
182
        return $this->position;
183
    }
184
185
    /**
186
     * @param int $position
187
     */
188
    public function setPosition(int $position)
189
    {
190
        $this->position = $position;
191
    }
192
}
193