Enums
7 months ago
ApiConnection.php
7 months ago
MemberLevel.php
7 months ago
MemberSection.php
7 months ago
Membership.php
7 months ago
MembershipChange.php
7 months ago
Page.php
7 months ago
Settings.php
7 months ago
User.php
7 months ago
ApiConnection.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace FapiMember\Model; |
| 4 | |
| 5 | use FapiMember\Library\SmartEmailing\Types\StringType; |
| 6 | |
| 7 | class ApiConnection |
| 8 | { |
| 9 | private string|null $apiUser; |
| 10 | private string|null $apiKey; |
| 11 | |
| 12 | public function __construct(string|null $apiUser, string|null $apiKey) |
| 13 | { |
| 14 | $this->apiUser = StringType::fromOrNull($apiUser); |
| 15 | $this->apiKey = StringType::fromOrNull($apiKey); |
| 16 | } |
| 17 | |
| 18 | public function getApiUser(): string|null |
| 19 | { |
| 20 | return $this->apiUser; |
| 21 | } |
| 22 | |
| 23 | public function getApiKey(): string|null |
| 24 | { |
| 25 | return $this->apiKey; |
| 26 | } |
| 27 | |
| 28 | public function toArray(): array |
| 29 | { |
| 30 | return [ |
| 31 | 'api_user' => $this->apiUser, |
| 32 | 'api_key' => $this->apiKey, |
| 33 | ]; |
| 34 | } |
| 35 | |
| 36 | } |
| 37 |