Overview

Namespaces

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

Classes

  • Activity
  • ActivityError
  • AddContacts
  • AddContactsImportData
  • ExportContacts
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace Ctct\Components\Activities;
 3: 
 4: use Ctct\Components\Component;
 5: use Ctct\Components\Contacts\Contact;
 6: use Ctct\Components\Contacts\Address;
 7: use Ctct\Components\Contacts\CustomField;
 8:  
 9: /**
10:  * Represents a single Activity in Constant Contact
11:  *
12:  * @package     Components
13:  * @subpackage     Activities
14:  * @author         Constant Contact
15:  */
16: class AddContactsImportData extends Component
17: {
18:     public $first_name;
19:     public $middle_name;
20:     public $last_name;
21:     public $job_title;
22:     public $company_name;
23:     public $work_phone;
24:     public $home_phone;
25: 
26:     public $email_addresses = array();
27:     public $addresses = array();
28:     public $custom_fields = array();
29: 
30:     /**
31:      * Factory method to create an Activity object from an array
32:      * @param array $props - associative array of initial properties to set
33:      * @return Campaign
34:      */
35:     public function __construct(array $props = array())
36:     {
37:         foreach ($this as $property => $value) {
38:             $this->$property = parent::getValue($props, $property);
39:         }
40:     }
41: 
42:     public function addCustomField(CustomField $customField)
43:     {
44:         $this->custom_fields[] = $customField;
45:     }
46: 
47:     public function addAddress(Address $address)
48:     {
49:         $address->state_code = $address->state;
50:         unset($address->state);
51: 
52:         foreach ($address as $key => $value) {
53:             if ($value == null) {
54:                 unset($address->$key);
55:             }
56:         }
57:         $this->addresses[] = $address;
58:     }
59: 
60:     public function addEmail($emailAddress)
61:     {
62:         $this->email_addresses[] = $emailAddress;
63:     }
64: 
65:     public function toJson()
66:     {
67:         return json_encode($this);
68:     }
69: }
70: 
Appconnect PHP SDK API documentation generated by ApiGen 2.8.0