1: <?php
2: namespace Ctct\Components\Tracking;
3:
4: /**
5: * Class to wrap a result set of individual activities (ie: OpensActivity, SendActivity)
6: *
7: * @package Components
8: * @subpackage CampaignTracking
9: * @author Constant Contact
10: */
11: class TrackingActivity
12: {
13: public $results = array();
14: public $next;
15:
16: /**
17: * Constructor to create a TrackingActivity from the results/pagination response from getting a set of activities
18: * @param array $results - results array from a tracking endpoint
19: * @param array $pagination - pagination array returned from a tracking endpoint
20: */
21: public function __construct(array $results, array $pagination)
22: {
23: $this->results = $results;
24:
25: if (array_key_exists('next', $pagination)) {
26: $this->next = substr($pagination['next'], strrpos($pagination['next'], '&next=') + 6);
27: }
28: }
29: }
30: