1: <?php
2:
3: namespace Ctct\Components\Tracking;
4:
5: use Ctct\Components\Component;
6:
7: /**
8: * Represents a single Opt Out Activity
9: *
10: * @package Components
11: * @subpackage CampaignTracking
12: * @author Constant Contact
13: */
14: class OptOutActivity extends Component
15: {
16: public $activity_type;
17: public $campaign_id;
18: public $contact_id;
19: public $email_address;
20: public $unsubscribe_date;
21: public $unsubscribe_source;
22: public $unsubscribe_reason;
23:
24: /**
25: * Factory method to create an OptOutActivity object from an array
26: * @param array $props - array of properties to create object from
27: * @return ClickActivity
28: */
29: public static function create(array $props)
30: {
31: $opt_out_activity = new OptOutActivity();
32: $opt_out_activity->activity_type = parent::getValue($props, "activity_type");
33: $opt_out_activity->unsubscribe_date = parent::getValue($props, "unsubscribe_date");
34: $opt_out_activity->unsubscribe_source = parent::getValue($props, "unsubscribe_source");
35: $opt_out_activity->unsubscribe_reason = parent::getValue($props, "unsubscribe_reason");
36: $opt_out_activity->contact_id = parent::getValue($props, "contact_id");
37: $opt_out_activity->email_address = parent::getValue($props, "email_address");
38: $opt_out_activity->campaign_id = parent::getValue($props, "campaign_id");
39: return $opt_out_activity;
40: }
41: }
42: