Total Complexity | 8 |
Total Lines | 111 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | final class AccountModel extends AbstractModel |
||
6 | { |
||
7 | /** |
||
8 | * The account subdomain. |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $subdomain; |
||
13 | |||
14 | /** |
||
15 | * The account plan. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $plan; |
||
20 | |||
21 | /** |
||
22 | * The number of people associated with the account. |
||
23 | * |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $peopleCount; |
||
27 | |||
28 | /** |
||
29 | * The account storage. |
||
30 | * |
||
31 | * @var int |
||
32 | */ |
||
33 | protected $storage; |
||
34 | |||
35 | /** |
||
36 | * The account color theme. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $colorTheme; |
||
41 | |||
42 | /** |
||
43 | * Whether or not SSL (TLS) is enabled. |
||
44 | * |
||
45 | * @var bool |
||
46 | */ |
||
47 | protected $sslEnabled; |
||
48 | |||
49 | use GroupAndOwnerAwareTrait; |
||
50 | |||
51 | public function __construct(string $xml) |
||
52 | { |
||
53 | parent::__construct($xml); |
||
54 | $this->subdomain = (string) $this->getXml()->xpath('//subdomain')[0]; |
||
55 | $this->plan = (string) $this->getXml()->xpath('//plan')[0]; |
||
56 | $this->ownerId = (int) $this->getXml()->xpath('//owner-id')[0]; |
||
57 | $this->peopleCount = (int) $this->getXml()->xpath('//people-count')[0]; |
||
58 | $this->storage = (int) $this->getXml()->xpath('//storage')[0]; |
||
59 | $this->colorTheme = (string) $this->getXml()->xpath('//color_theme')[0]; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getSubdomain(): string |
||
66 | { |
||
67 | return $this->subdomain; |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getPlan(): string |
||
74 | { |
||
75 | return $this->plan; |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getOwnerId(): string |
||
82 | { |
||
83 | return $this->ownerId; |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return int |
||
88 | */ |
||
89 | public function getPeopleCount(): int |
||
92 | } |
||
93 | |||
94 | /** |
||
95 | * @return int |
||
96 | */ |
||
97 | public function getStorage(): int |
||
98 | { |
||
99 | return $this->storage; |
||
100 | } |
||
101 | |||
102 | /** |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getColorTheme(): string |
||
108 | } |
||
109 | |||
110 | /** |
||
111 | * @return bool |
||
112 | */ |
||
113 | public function isSslEnabled(): bool |
||
116 | } |
||
117 | } |
||
118 |