Completed
Pull Request — develop (#147)
by Wachter
14:07
created

ArticlePageDocument   A

Complexity

Total Complexity 29

Size/Duplication

Total Lines 324
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 29
lcom 2
cbo 2
dl 0
loc 324
rs 10
c 1
b 0
f 0

29 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getUuid() 0 4 1
A setUuid() 0 6 1
A getTitle() 0 4 1
A setTitle() 0 6 1
A getPageTitle() 0 4 1
A setPageTitle() 0 6 1
A getParent() 0 4 1
A setParent() 0 6 1
A getPath() 0 4 1
A getLocale() 0 4 1
A setLocale() 0 6 1
A getOriginalLocale() 0 4 1
A setOriginalLocale() 0 6 1
A getStructureType() 0 4 1
A setStructureType() 0 6 1
A getStructure() 0 4 1
A getId() 0 4 1
A getRoute() 0 4 1
A setRoute() 0 6 1
A getRoutePath() 0 4 1
A setRoutePath() 0 4 1
A getClass() 0 4 1
A getPageNumber() 0 4 1
A setPageNumber() 0 6 1
A getArticleUuid() 0 4 1
A getPageUuid() 0 4 1
A getWorkflowStage() 0 4 1
A getExtensionsData() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Bundle\ArticleBundle\Document;
13
14
use Sulu\Bundle\ArticleBundle\Document\Behavior\PageBehavior;
15
use Sulu\Bundle\ArticleBundle\Document\Behavior\RoutablePageBehavior;
16
use Sulu\Bundle\RouteBundle\Model\RouteInterface;
17
use Sulu\Component\Content\Document\Behavior\StructureBehavior;
18
use Sulu\Component\Content\Document\Structure\Structure;
19
use Sulu\Component\Content\Document\Structure\StructureInterface;
20
use Sulu\Component\DocumentManager\Behavior\Mapping\LocalizedTitleBehavior;
21
use Sulu\Component\DocumentManager\Behavior\Mapping\ParentBehavior;
22
use Sulu\Component\DocumentManager\Behavior\Mapping\PathBehavior;
23
use Sulu\Component\DocumentManager\Behavior\Mapping\UuidBehavior;
24
use Sulu\Component\DocumentManager\Behavior\Path\AutoNameBehavior;
25
26
/**
27
 * Represents an article-page in phpcr.
28
 */
29
class ArticlePageDocument implements
30
    UuidBehavior,
31
    LocalizedTitleBehavior,
32
    ParentBehavior,
33
    AutoNameBehavior,
34
    PathBehavior,
35
    StructureBehavior,
36
    RoutablePageBehavior,
37
    PageBehavior,
38
    ArticleInterface
39
{
40
    /**
41
     * @var string
42
     */
43
    private $uuid;
44
45
    /**
46
     * @var string
47
     */
48
    private $title;
49
50
    /**
51
     * @var string
52
     */
53
    private $pageTitle;
54
55
    /**
56
     * @var ArticleDocument
57
     */
58
    private $parent;
59
60
    /**
61
     * @var string
62
     */
63
    private $path;
64
65
    /**
66
     * @var string
67
     */
68
    private $locale;
69
70
    /**
71
     * @var string
72
     */
73
    private $originalLocale;
74
75
    /**
76
     * @var string
77
     */
78
    private $structureType;
79
80
    /**
81
     * @var StructureInterface
82
     */
83
    private $structure;
84
85
    /**
86
     * @var RouteInterface
87
     */
88
    private $route;
89
90
    /**
91
     * @var string
92
     */
93
    private $routePath;
94
95
    /**
96
     * @var int
97
     */
98
    private $pageNumber;
99
100
    public function __construct()
101
    {
102
        $this->structure = new Structure();
103
    }
104
105
    /**
106
     * {@inheritdoc}
107
     */
108
    public function getUuid()
109
    {
110
        return $this->uuid;
111
    }
112
113
    /**
114
     * {@inheritdoc}
115
     */
116
    public function setUuid($uuid)
117
    {
118
        $this->uuid = $uuid;
119
120
        return $this;
121
    }
122
123
    /**
124
     * {@inheritdoc}
125
     */
126
    public function getTitle()
127
    {
128
        return $this->title;
129
    }
130
131
    /**
132
     * {@inheritdoc}
133
     */
134
    public function setTitle($title)
135
    {
136
        $this->title = $title;
137
138
        return $this;
139
    }
140
141
    /**
142
     * Returns pageTitle.
143
     *
144
     * @return string
145
     */
146
    public function getPageTitle()
147
    {
148
        return $this->pageTitle;
149
    }
150
151
    /**
152
     * Set pageTitle.
153
     *
154
     * @param string $pageTitle
155
     *
156
     * @return $this
157
     */
158
    public function setPageTitle($pageTitle)
159
    {
160
        $this->pageTitle = $pageTitle;
161
162
        return $this;
163
    }
164
165
    /**
166
     * {@inheritdoc}
167
     */
168
    public function getParent()
169
    {
170
        return $this->parent;
171
    }
172
173
    /**
174
     * {@inheritdoc}
175
     */
176
    public function setParent($parent)
177
    {
178
        $this->parent = $parent;
179
180
        return $this;
181
    }
182
183
    /**
184
     * {@inheritdoc}
185
     */
186
    public function getPath()
187
    {
188
        return $this->path;
189
    }
190
191
    /**
192
     * {@inheritdoc}
193
     */
194
    public function getLocale()
195
    {
196
        return $this->locale;
197
    }
198
199
    /**
200
     * {@inheritdoc}
201
     */
202
    public function setLocale($locale)
203
    {
204
        $this->locale = $locale;
205
206
        return $this;
207
    }
208
209
    /**
210
     * {@inheritdoc}
211
     */
212
    public function getOriginalLocale()
213
    {
214
        return $this->originalLocale;
215
    }
216
217
    /**
218
     * {@inheritdoc}
219
     */
220
    public function setOriginalLocale($originalLocale)
221
    {
222
        $this->originalLocale = $originalLocale;
223
224
        return $this;
225
    }
226
227
    /**
228
     * {@inheritdoc}
229
     */
230
    public function getStructureType()
231
    {
232
        return $this->structureType;
233
    }
234
235
    /**
236
     * {@inheritdoc}
237
     */
238
    public function setStructureType($structureType)
239
    {
240
        $this->structureType = $structureType;
241
242
        return $this;
243
    }
244
245
    /**
246
     * {@inheritdoc}
247
     */
248
    public function getStructure()
249
    {
250
        return $this->structure;
251
    }
252
253
    /**
254
     * {@inheritdoc}
255
     */
256
    public function getId()
257
    {
258
        return $this->uuid;
259
    }
260
261
    /**
262
     * {@inheritdoc}
263
     */
264
    public function getRoute()
265
    {
266
        return $this->route;
267
    }
268
269
    /**
270
     * {@inheritdoc}
271
     */
272
    public function setRoute(RouteInterface $route)
273
    {
274
        $this->route = $route;
275
276
        return $this;
277
    }
278
279
    /**
280
     * {@inheritdoc}
281
     */
282
    public function getRoutePath()
283
    {
284
        return $this->routePath;
285
    }
286
287
    /**
288
     * {@inheritdoc}
289
     */
290
    public function setRoutePath($routePath)
291
    {
292
        $this->routePath = $routePath;
293
    }
294
295
    /**
296
     * {@inheritdoc}
297
     */
298
    public function getClass()
299
    {
300
        return self::class;
301
    }
302
303
    /**
304
     * {@inheritdoc}
305
     */
306
    public function getPageNumber()
307
    {
308
        return $this->pageNumber;
309
    }
310
311
    /**
312
     * {@inheritdoc}
313
     */
314
    public function setPageNumber($pageNumber)
315
    {
316
        $this->pageNumber = $pageNumber;
317
318
        return $this;
319
    }
320
321
    /**
322
     * {@inheritdoc}
323
     */
324
    public function getArticleUuid()
325
    {
326
        return $this->getParent()->getUuid();
327
    }
328
329
    /**
330
     * {@inheritdoc}
331
     */
332
    public function getPageUuid()
333
    {
334
        return $this->getUuid();
335
    }
336
337
    /**
338
     * {@inheritdoc}
339
     */
340
    public function getWorkflowStage()
341
    {
342
        return $this->getParent()->getWorkflowStage();
343
    }
344
345
    /**
346
     * {@inheritdoc}
347
     */
348
    public function getExtensionsData()
349
    {
350
        return $this->getParent()->getExtensionsData();
351
    }
352
}
353