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