This repository was archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathAccountInfo.php
More file actions
107 lines (92 loc) · 2.7 KB
/
AccountInfo.php
File metadata and controls
107 lines (92 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
namespace YousafSaqib\ConstantContact\Components\Account;
use YousafSaqib\ConstantContact\Components\Component;
/**
* Represents account info associated with an access token in Constant Contact
*
* @package Components
* @subpackage Account
* @author ewaltman
*/
class AccountInfo extends Component
{
/**
* Website associated with the account
* @var string
*/
public $website;
/**
* Name of organization associated with the account
* @var string
*/
public $organization_name;
/**
* Time zone used with the account
* @var string
*/
public $time_zone;
/**
* First name of the account user
* @var string
*/
public $first_name;
/**
* Last name of the account user
* @var string
*/
public $last_name;
/**
* Email address associated with the account
* @var string
*/
public $email;
/**
* Phone number associated with the account
* @var string
*/
public $phone;
/**
* URL of the company logo associated with the account
* @var string
*/
public $company_logo;
/**
* Country code associated with the account
* @var string
*/
public $country_code;
/**
* State code associated with the account
* @var string
*/
public $state_code;
/**
* Array of organization addresses associated with the account
* @var array
*/
public $organization_addresses;
/**
* Factory method to create an AccountInfo object from an array
* @param array $props - associative array of initial properties to set
* @return AccountInfo
*/
public static function create(array $props)
{
$accountInfo = new AccountInfo();
$accountInfo->website = parent::getValue($props, "website");
$accountInfo->organization_name = parent::getValue($props, "organization_name");
$accountInfo->time_zone = parent::getValue($props, "time_zone");
$accountInfo->first_name = parent::getValue($props, "first_name");
$accountInfo->last_name = parent::getValue($props, "last_name");
$accountInfo->email = parent::getValue($props, "email");
$accountInfo->phone = parent::getValue($props, "phone");
$accountInfo->company_logo = parent::getValue($props, "company_logo");
$accountInfo->country_code = parent::getValue($props, "country_code");
$accountInfo->state_code = parent::getValue($props, "state_code");
$accountInfo->organization_addresses = parent::getValue($props, "organization_addresses");
return $accountInfo;
}
public function toJson() {
return json_encode($this);
}
}