Overview

Namespaces

  • Ctct
    • Auth
    • Components
      • Account
      • Activities
      • Contacts
      • EmailMarketing
      • Tracking
    • Exceptions
    • Services
  • PHP

Classes

  • Address
  • Contact
  • ContactList
  • CustomField
  • EmailAddress
  • Note
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Ctct\Components\Contacts;
 3: 
 4: use Ctct\Components\Component;
 5: 
 6: /**
 7:  * Represents a single Address of a Contact
 8:  *
 9:  * @package        Components
10:  * @subpackage     Contacts
11:  * @author         Constant Contact
12:  */
13: class Address extends Component
14: {
15: 
16:     /**
17:      * Id of the address
18:      * @var string
19:      */
20:     public $id;
21: 
22:     /**
23:      * Line 1 of the address
24:      * @var string
25:      */
26:     public $line1;
27: 
28:     /**
29:      * Line 2 of the address
30:      * @var string
31:      */
32:     public $line2;
33: 
34:     /**
35:      * Line 3 of the address
36:      * @var string
37:      */
38:     public $line3;
39: 
40:     /**
41:      * City info for this address
42:      * @var string
43:      */
44:     public $city;
45: 
46:     /**
47:      * Address type, must be one of "BUSINESS", "PERSONAL", or "UNKNOWN"
48:      * @var string
49:      */
50:     public $address_type;
51: 
52:     /**
53:      * The state code for this address
54:      * @var string
55:      */
56:     public $state_code;
57: 
58:     /**
59:      * The country code for this address
60:      * @var string
61:      */
62:     public $country_code;
63: 
64:     /**
65:      * The postal code for this address
66:      * @var string
67:      */
68:     public $postal_code;
69: 
70:     /**
71:      * The sub postal code for this address
72:      * @var string
73:      */
74:     public $sub_postal_code;
75: 
76:     /**
77:      * Factory method to create an Address object from an array
78:      * @array $props - Associative array of initial properties to set
79:      * @return Address
80:      */
81:     public static function create(array $props)
82:     {
83:         $address = new Address();
84:         $address->id = parent::getValue($props, "id");
85:         $address->line1 = parent::getValue($props, "line1");
86:         $address->line2 = parent::getValue($props, "line2");
87:         $address->line3 = parent::getValue($props, "line3");
88:         $address->city = parent::getValue($props, "city");
89:         $address->address_type = parent::getValue($props, "address_type");
90:         $address->state_code = parent::getValue($props, "state_code");
91:         $address->country_code = parent::getValue($props, "country_code");
92:         $address->postal_code = parent::getValue($props, "postal_code");
93:         $address->sub_postal_code = parent::getValue($props, "sub_postal_code");
94:         return $address;
95:     }
96: }
97: 
Appconnect PHP SDK API documentation generated by ApiGen 2.8.0