1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Acquia\LiftClient\Entity; |
4
|
|
|
|
5
|
|
|
use Acquia\LiftClient\Exception\LiftSdkException; |
6
|
|
|
|
7
|
|
|
class CapturePayload extends CaptureBase |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Sets the 'touch_identifier' parameter. |
11
|
|
|
* |
12
|
|
|
* @param string $touchIdentifier Internal identifier for the touch, if this field is left empty, lift will |
13
|
|
|
* generate a touch identifier and include it in the response |
14
|
|
|
* |
15
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
16
|
|
|
* |
17
|
|
|
* @return \Acquia\LiftClient\Entity\CapturePayload |
18
|
|
|
*/ |
19
|
|
View Code Duplication |
public function setTouchIdentifier($touchIdentifier) |
20
|
|
|
{ |
21
|
|
|
if (!is_string($touchIdentifier)) { |
22
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
23
|
|
|
} |
24
|
|
|
$this['touch_identifier'] = $touchIdentifier; |
25
|
|
|
|
26
|
|
|
return $this; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Sets the 'identity' parameter. |
31
|
|
|
* |
32
|
|
|
* @param string $identity Visitor's primary identity information |
33
|
|
|
* |
34
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
35
|
|
|
* |
36
|
|
|
* @return \Acquia\LiftClient\Entity\CapturePayload |
37
|
|
|
*/ |
38
|
|
|
public function setIdentity($identity) |
39
|
|
|
{ |
40
|
|
|
if (!is_string($identity)) { |
41
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
42
|
|
|
} |
43
|
|
|
$this['identity'] = $identity; |
44
|
|
|
|
45
|
|
|
return $this; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Sets the 'identity_source' parameter. |
50
|
|
|
* |
51
|
|
|
* @param string $identitySource Type of visitor's primary identity information. Specific string (account, email, |
52
|
|
|
* facebook, twitter, tracking, name) or custom identifier type |
53
|
|
|
* |
54
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
55
|
|
|
* |
56
|
|
|
* @return \Acquia\LiftClient\Entity\CapturePayload |
57
|
|
|
*/ |
58
|
|
View Code Duplication |
public function setIdentitySource($identitySource) |
59
|
|
|
{ |
60
|
|
|
if (!is_string($identitySource)) { |
61
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
62
|
|
|
} |
63
|
|
|
$this['identity_source'] = $identitySource; |
64
|
|
|
|
65
|
|
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Sets the 'do_not_track' parameter. |
70
|
|
|
* |
71
|
|
|
* @param bool $doNotTrack Flag to indicate whether the person should not be tracked |
72
|
|
|
* |
73
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
74
|
|
|
* |
75
|
|
|
* @return \Acquia\LiftClient\Entity\CapturePayload |
76
|
|
|
*/ |
77
|
|
View Code Duplication |
public function setDoNotTrack($doNotTrack) |
78
|
|
|
{ |
79
|
|
|
if (!is_bool($doNotTrack)) { |
80
|
|
|
throw new LiftSdkException('Argument must be an instance of boolean.'); |
81
|
|
|
} |
82
|
|
|
$this['do_not_track'] = $doNotTrack; |
83
|
|
|
|
84
|
|
|
return $this; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Sets the 'return_segments' parameter. |
89
|
|
|
* |
90
|
|
|
* @param bool $returnSegments Flag to indicate whether the person should not be tracked |
91
|
|
|
* |
92
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
93
|
|
|
* |
94
|
|
|
* @return \Acquia\LiftClient\Entity\CapturePayload |
95
|
|
|
*/ |
96
|
|
|
public function setReturnSegments($returnSegments) |
97
|
|
|
{ |
98
|
|
|
if (!is_bool($returnSegments)) { |
99
|
|
|
throw new LiftSdkException('Argument must be an instance of boolean.'); |
100
|
|
|
} |
101
|
|
|
$this['return_segments'] = $returnSegments; |
102
|
|
|
|
103
|
|
|
return $this; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* Sets the 'captures' parameter. |
108
|
|
|
* |
109
|
|
|
* @param Capture[] $captures List of captures |
110
|
|
|
* |
111
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
112
|
|
|
* |
113
|
|
|
* @return \Acquia\LiftClient\Entity\CapturePayload |
114
|
|
|
*/ |
115
|
|
View Code Duplication |
public function setCaptures($captures) |
116
|
|
|
{ |
117
|
|
|
$this['captures'] = []; |
118
|
|
|
foreach ($captures as $capture) { |
119
|
|
|
$this['captures'][] = $capture->getArrayCopy(); |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
return $this; |
123
|
|
|
} |
124
|
|
|
} |
125
|
|
|
|