Completed
Push — master ( ffddc8...a95708 )
by Rafał
09:43
created

Tenant::getAppleNewsConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Core 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\CoreBundle\Model;
16
17
use SWP\Bundle\ContentBundle\Model\RouteInterface;
18
use SWP\Component\MultiTenancy\Model\Tenant as BaseTenant;
19
use SWP\Component\OutputChannel\Model\OutputChannelAwareInterface;
20
use SWP\Component\OutputChannel\Model\OutputChannelInterface as BaseOutputChannelInterface;
21
22
class Tenant extends BaseTenant implements TenantInterface, ArticlesCountInterface, OutputChannelAwareInterface
23
{
24
    use ArticlesCountTrait;
25
26
    /**
27
     * @var string
28
     */
29
    protected $themeName;
30
31
    /**
32
     * @var RouteInterface
33
     */
34
    protected $homepage;
35
36
    /**
37
     * @var bool
38
     */
39
    protected $ampEnabled = false;
40
41
    /**
42
     * @var BaseOutputChannelInterface|null
43
     */
44
    protected $outputChannel;
45 44
46
    /** @var AppleNewsConfig|null */
47 44
    protected $appleNewsConfig;
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function getThemeName()
53 104
    {
54
        return $this->themeName;
55 104
    }
56 104
57
    /**
58
     * {@inheritdoc}
59
     */
60
    public function setThemeName($themeName)
61 2
    {
62
        $this->themeName = $themeName;
63 2
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function getHomepage()
69 104
    {
70
        return $this->homepage;
71 104
    }
72 104
73
    /**
74
     * {@inheritdoc}
75
     */
76
    public function setHomepage(RouteInterface $homepage)
77 7
    {
78
        $this->homepage = $homepage;
79 7
    }
80
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function isAmpEnabled(): bool
85 1
    {
86
        return $this->ampEnabled;
87 1
    }
88 1
89
    /**
90
     * {@inheritdoc}
91
     */
92
    public function setAmpEnabled(bool $ampEnabled)
93 8
    {
94
        $this->ampEnabled = $ampEnabled;
95 8
    }
96
97
    /**
98
     * {@inheritdoc}
99
     */
100
    public function getOutputChannel(): ?BaseOutputChannelInterface
101 104
    {
102
        return $this->outputChannel;
103 104
    }
104 104
105
    /**
106
     * {@inheritdoc}
107
     */
108
    public function setOutputChannel(?BaseOutputChannelInterface $outputChannel): void
109
    {
110
        $this->outputChannel = $outputChannel;
111
112
        if ($outputChannel instanceof OutputChannelInterface) {
113
            $outputChannel->setTenant($this);
114
        }
115
    }
116
117
    public function getAppleNewsConfig(): ?AppleNewsConfig
118
    {
119
        return $this->appleNewsConfig;
120
    }
121
122
    public function setAppleNewsConfig(?AppleNewsConfig $appleNewsConfig): void
123
    {
124
        $this->appleNewsConfig = $appleNewsConfig;
125
    }
126
}
127