Tenant   A
last analyzed

Complexity

Total Complexity 14

Size/Duplication

Total Lines 148
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 14
lcom 0
cbo 3
dl 0
loc 148
rs 10
c 0
b 0
f 0

14 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A setId() 0 4 1
A getSubdomain() 0 4 1
A setSubdomain() 0 4 1
A getName() 0 4 1
A setName() 0 4 1
A getCode() 0 4 1
A setCode() 0 4 1
A setOrganization() 0 4 1
A getOrganization() 0 4 1
A getDomainName() 0 4 1
A setDomainName() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher MultiTenancy Component.
5
 *
6
 * Copyright 2015 Sourcefabric z.u. 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 2015 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Component\MultiTenancy\Model;
16
17
use SWP\Component\Common\Model\EnableableTrait;
18
use SWP\Component\Common\Model\SoftDeletableTrait;
19
use SWP\Component\Common\Model\TimestampableTrait;
20
21
class Tenant implements TenantInterface
22
{
23
    use SoftDeletableTrait;
24
    use TimestampableTrait;
25
    use EnableableTrait;
26
27
    /**
28
     * @var mixed
29
     */
30
    protected $id;
31
32
    /**
33
     * @var string
34
     */
35
    protected $subdomain;
36
37
    /**
38
     * @var string
39
     */
40
    protected $domainName;
41
42
    /**
43
     * @var string
44
     */
45
    protected $name;
46
47
    /**
48
     * @var string
49
     */
50
    protected $code;
51
52
    /**
53
     * @var OrganizationInterface
54
     */
55
    protected $organization;
56
57
    /**
58
     * Tenant constructor.
59
     */
60
    public function __construct()
61
    {
62
        $this->createdAt = new \DateTime();
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function getId()
69
    {
70
        return $this->id;
71
    }
72
73
    /**
74
     * {@inheritdoc}
75
     */
76
    public function setId($id)
77
    {
78
        $this->id = $id;
79
    }
80
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function getSubdomain()
85
    {
86
        return $this->subdomain;
87
    }
88
89
    /**
90
     * {@inheritdoc}
91
     */
92
    public function setSubdomain($subdomain)
93
    {
94
        $this->subdomain = $subdomain;
95
    }
96
97
    /**
98
     * {@inheritdoc}
99
     */
100
    public function getName()
101
    {
102
        return $this->name;
103
    }
104
105
    /**
106
     * {@inheritdoc}
107
     */
108
    public function setName($name)
109
    {
110
        $this->name = $name;
111
    }
112
113
    /**
114
     * {@inheritdoc}
115
     */
116
    public function getCode()
117
    {
118
        return $this->code;
119
    }
120
121
    /**
122
     * {@inheritdoc}
123
     */
124
    public function setCode($code)
125
    {
126
        $this->code = $code;
127
    }
128
129
    /**
130
     * {@inheritdoc}
131
     */
132
    public function setOrganization(OrganizationInterface $organization)
133
    {
134
        $this->organization = $organization;
135
    }
136
137
    /**
138
     * {@inheritdoc}
139
     */
140
    public function getOrganization()
141
    {
142
        return $this->organization;
143
    }
144
145
    /**
146
     * {@inheritdoc}
147
     */
148
    public function getDomainName()
149
    {
150
        return $this->domainName;
151
    }
152
153
    /**
154
     * {@inheritdoc}
155
     */
156
    public function setDomainName($domainName)
157
    {
158
        $this->domainName = $domainName;
159
    }
160
161
    /**
162
     * @return string
163
     */
164
    public function __toString()
165
    {
166
        return (string) $this->subdomain;
167
    }
168
}
169