PluginProbe ʕ •ᴥ•ʔ
FAPI Member / 2.2.25
FAPI Member v2.2.25
2.2.33 2.2.32 trunk 1.9.47 2.1.18 2.2.24 2.2.25 2.2.26 2.2.28 2.2.29 2.2.30 2.2.31
fapi-member / src / Model / Settings.php
fapi-member / src / Model Last commit date
Enums 9 months ago ApiConnection.php 9 months ago MemberLevel.php 9 months ago MemberSection.php 9 months ago Membership.php 9 months ago MembershipChange.php 9 months ago Page.php 9 months ago Settings.php 9 months ago User.php 9 months ago
Settings.php
62 lines
1 <?php
2
3 namespace FapiMember\Model;
4
5 use FapiMember\Model\Enums\Keys\SettingsKey;
6 use FapiMember\Library\SmartEmailing\Types\IntType;
7
8 class Settings
9 {
10 private int|null $timeLockedPageId;
11 private int|null $loginPageId;
12 private int|null $dashboardPageId;
13
14 public function __construct(array $data)
15 {
16 $this->timeLockedPageId = IntType::extractOrNull($data, SettingsKey::TIME_LOCKED_PAGE);
17 $this->loginPageId = IntType::extractOrNull($data, SettingsKey::LOGIN_PAGE);
18 $this->dashboardPageId = IntType::extractOrNull($data, SettingsKey::DASHBOARD_PAGE);
19 }
20
21 public function getTimeLockedPageId(): int|null
22 {
23 return $this->timeLockedPageId;
24 }
25
26 public function getLoginPageId(): int|null
27 {
28 return $this->loginPageId;
29 }
30
31 public function getDashboardPageId(): int|null
32 {
33 return $this->dashboardPageId;
34 }
35
36 public function setTimeLockedPageId(int|null $timeLockedPageId): void
37 {
38 $this->timeLockedPageId = $timeLockedPageId;
39 }
40
41 public function setLoginPageId(int|null $loginPageId): void
42 {
43 $this->loginPageId = $loginPageId;
44 }
45
46 public function setDashboardPageId(int|null $dashboardPageId): void
47 {
48 $this->dashboardPageId = $dashboardPageId;
49 }
50
51 /** @return array<string> */
52 public function toArray(): array
53 {
54 return [
55 SettingsKey::TIME_LOCKED_PAGE => $this->timeLockedPageId,
56 SettingsKey::LOGIN_PAGE => $this->loginPageId,
57 SettingsKey::DASHBOARD_PAGE => $this->dashboardPageId,
58 ];
59 }
60
61 }
62