Completed
Push — 2.1 ( 63ded9...b14dac )
by Paweł
23s queued 11s
created

ArticleDocument::getComponentLayouts()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Web Publisher Core Bundle.
7
 *
8
 * Copyright 2020 Sourcefabric z.ú. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2020 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Bundle\CoreBundle\AppleNews\Document;
18
19
use SWP\Bundle\CoreBundle\AppleNews\Component\ComponentInterface;
20
21
/**
22
 * The root object of an Apple News article, containing required properties,
23
 * metadata, content, layout, and styles.
24
 */
25
class ArticleDocument
26
{
27
    public const APPLE_NEWS_FORMAT_VERSION = '1.7';
28
29
    private $title;
30
31
    private $subtitle = '';
32
33
    private $components = [];
34
35
    /** @var Metadata */
36
    private $metadata;
37
38
    private $identifier;
39
40
    private $language;
41
42
    private $version = self::APPLE_NEWS_FORMAT_VERSION;
43
44
    /** @var Layout */
45
    private $layout;
46
47
    /** @var ComponentTextStyles */
48
    private $componentTextStyles;
49
50
    /** @var ComponentLayouts|null */
51
    private $componentLayouts;
52
53
    /**
54
     * @param ComponentTextStyles $componentTextStyles
55
     */
56
    public function setComponentTextStyles(ComponentTextStyles $componentTextStyles): void
57
    {
58
        $this->componentTextStyles = $componentTextStyles;
59
    }
60
61
    public function addComponent(ComponentInterface $component): void
62
    {
63
        $this->components[] = $component;
64
    }
65
66
    public function getComponents(): array
67
    {
68
        return $this->components;
69
    }
70
71
    public function getIdentifier(): string
72
    {
73
        return $this->identifier;
74
    }
75
76
    public function setIdentifier(string $identifier): void
77
    {
78
        $this->identifier = $identifier;
79
    }
80
81
    public function getLanguage(): string
82
    {
83
        return $this->language;
84
    }
85
86
    public function setLanguage(string $language): void
87
    {
88
        $this->language = $language;
89
    }
90
91
    public function setTitle(string $title): void
92
    {
93
        $this->title = $title;
94
    }
95
96
    public function getTitle(): string
97
    {
98
        return $this->title;
99
    }
100
101
    public function getSubtitle(): string
102
    {
103
        return $this->subtitle;
104
    }
105
106
    public function setSubtitle(string $subtitle): void
107
    {
108
        $this->subtitle = $subtitle;
109
    }
110
111
    public function setLayout(Layout $layout): void
112
    {
113
        $this->layout = $layout;
114
    }
115
116
    public function getMetadata(): Metadata
117
    {
118
        return $this->metadata;
119
    }
120
121
    public function setMetadata(Metadata $metadata): void
122
    {
123
        $this->metadata = $metadata;
124
    }
125
126
    public function getVersion(): string
127
    {
128
        return $this->version;
129
    }
130
131
    public function getLayout(): Layout
132
    {
133
        return $this->layout;
134
    }
135
136
    public function getComponentTextStyles(): ComponentTextStyles
137
    {
138
        return $this->componentTextStyles;
139
    }
140
141
    public function getComponentLayouts(): ?ComponentLayouts
142
    {
143
        return $this->componentLayouts;
144
    }
145
146
    public function setComponentLayouts(ComponentLayouts $componentLayouts): void
147
    {
148
        $this->componentLayouts = $componentLayouts;
149
    }
150
}
151