1: <?php
2: namespace Ctct\Components\Tracking;
3:
4: use Ctct\Components\Component;
5:
6: 7: 8: 9: 10: 11: 12:
13: class TrackingSummary extends Component
14: {
15: public $sends;
16: public $opens;
17: public $clicks;
18: public $forwards;
19: public $unsubscribes;
20: public $bounces;
21: public $spam_count;
22:
23: 24: 25: 26: 27:
28: public static function create(array $props)
29: {
30: $tracking_summary = new TrackingSummary();
31: $tracking_summary->sends = parent::getValue($props, "sends");
32: $tracking_summary->opens = parent::getValue($props, "opens");
33: $tracking_summary->clicks = parent::getValue($props, "clicks");
34: $tracking_summary->forwards = parent::getValue($props, "forwards");
35: $tracking_summary->unsubscribes = parent::getValue($props, "unsubscribes");
36: $tracking_summary->bounces = parent::getValue($props, "bounces");
37: $tracking_summary->spam_count = parent::getValue($props, "spam_count");
38:
39:
40: if(is_null($tracking_summary->spam_count)) {
41: unset($tracking_summary->spam_count);
42: }
43:
44: return $tracking_summary;
45: }
46: }
47: