/** * Construct function for the Contact Class * * @param array $params - an array of variables that set up a contact object * @return object contact object with passed variables set to the object */ public function __construct($params = array()) { $utility = new CTCTUtility(); if (@$params['status'] == 'Do Not Mail') { $utility->setActionBy('ACTION_BY_CONTACT'); } $this->setLink(@$params['link']); $this->setId(@$params['id']); $this->setEmailAddress(@$params['email_address']); $this->setFirstName(@$params['first_name']); $this->setMiddleName(@$params['middle_name']); $this->setLastName(@$params['last_name']); $this->setCompanyName(@$params['company_name']); $this->setJobTitle(@$params['job_title']); $this->setHomeNumber(@$params['home_number']); $this->setWorkNumber(@$params['work_number']); $this->setAddr1(@$params['address_line_1']); $this->setAddr2(@$params['address_line_2']); $this->setAddr3(@$params['address_line_3']); $this->setCity(@$params['city_name']); $this->setStateCode(@$params['state_code']); $this->setStateName(@$params['state_name']); $this->setCountryCode(@$params['country_code']); $this->setPostalCode(@$params['zip_code']); $this->setSubPostalCode(@$params['sub_zip_code']); $this->setNotes(@$params['notes']); $this->setCustomField1(@$params['custom_field_1']); $this->setCustomField2(@$params['custom_field_2']); $this->setCustomField3(@$params['custom_field_3']); $this->setCustomField4(@$params['custom_field_4']); $this->setCustomField5(@$params['custom_field_5']); $this->setCustomField6(@$params['custom_field_6']); $this->setCustomField7(@$params['custom_field_7']); $this->setCustomField8(@$params['custom_field_8']); $this->setCustomField9(@$params['custom_field_9']); $this->setCustomField10(@$params['custom_field_10']); $this->setCustomField11(@$params['custom_field_11']); $this->setCustomField12(@$params['custom_field_12']); $this->setCustomField13(@$params['custom_field_13']); $this->setCustomField14(@$params['custom_field_14']); $this->setCustomField15(@$params['custom_field_15']); $this->setEmailType(@$params['mail_type']); $this->setOptInSource(isset($params['opt_in_source']) ? $params['opt_in_source'] : $utility->getActionBy()); // ZK mod if (@$params['lists']) { foreach (@$params['lists'] as $tmp) { $this->setLists($tmp); } } return $this; }