1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Acquia\LiftClient\Entity; |
4
|
|
|
|
5
|
|
|
use Acquia\LiftClient\Exception\LiftSdkException; |
6
|
|
|
use Acquia\LiftClient\Utility\Utility; |
7
|
|
|
use DateTime; |
8
|
|
|
|
9
|
|
|
class Capture extends Entity |
10
|
|
|
{ |
11
|
|
|
const PERSON_UDF_COUNT = 50; |
12
|
|
|
const EVENT_UDF_COUNT = 50; |
13
|
|
|
const TOUCH_UDF_COUNT = 20; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Set the 'person_udf#' field. |
17
|
|
|
* |
18
|
|
|
* @param int $num Which field to fetch. Can be from 1 till 50 |
19
|
|
|
* @param string $value Custom fields for the Acquia Lift Person Capture Phase |
20
|
|
|
* |
21
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
22
|
|
|
* |
23
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
24
|
|
|
*/ |
25
|
|
View Code Duplication |
public function setPersonUdf($num, $value) |
26
|
|
|
{ |
27
|
|
|
if (!is_int($num)) { |
28
|
|
|
throw new LiftSdkException('Argument $num must be an instance of integer.'); |
29
|
|
|
} |
30
|
|
|
if ($num < 1 || $num > self::PERSON_UDF_COUNT) { |
31
|
|
|
throw new LiftSdkException('Argument $num must be greater than 0 and smaller or equal to 50.'); |
32
|
|
|
} |
33
|
|
|
if (!is_string($value)) { |
34
|
|
|
throw new LiftSdkException('Argument $value must be an instance of string.'); |
35
|
|
|
} |
36
|
|
|
$this['person_udf'.$num] = $value; |
37
|
|
|
|
38
|
|
|
return $this; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Set the 'event_udf#' field. |
43
|
|
|
* |
44
|
|
|
* @param int $num Which field to fetch. Can be from 1 till 50 |
45
|
|
|
* @param string $value Custom fields for the Acquia Lift Event Capture Phase |
46
|
|
|
* |
47
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
48
|
|
|
* |
49
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
50
|
|
|
*/ |
51
|
|
View Code Duplication |
public function setEventUdf($num, $value) |
52
|
|
|
{ |
53
|
|
|
if (!is_int($num)) { |
54
|
|
|
throw new LiftSdkException('Argument $num must be an instance of integer.'); |
55
|
|
|
} |
56
|
|
|
if ($num < 1 || $num > self::EVENT_UDF_COUNT) { |
57
|
|
|
throw new LiftSdkException('Argument $num must be greater than 0 and smaller or equal to 50.'); |
58
|
|
|
} |
59
|
|
|
if (!is_string($value)) { |
60
|
|
|
throw new LiftSdkException('Argument $value must be an instance of string.'); |
61
|
|
|
} |
62
|
|
|
$this['event_udf'.$num] = $value; |
63
|
|
|
|
64
|
|
|
return $this; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Set the 'touch_udf#' field. |
69
|
|
|
* |
70
|
|
|
* @param int $num Which field to fetch. Can be from 1 till 20 |
71
|
|
|
* @param string $value Custom fields for the Acquia Lift Touch Capture Phase |
72
|
|
|
* |
73
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
74
|
|
|
* |
75
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
76
|
|
|
*/ |
77
|
|
View Code Duplication |
public function setTouchUdf($num, $value) |
78
|
|
|
{ |
79
|
|
|
if (!is_int($num)) { |
80
|
|
|
throw new LiftSdkException('Argument $num must be an instance of integer.'); |
81
|
|
|
} |
82
|
|
|
if ($num < 1 || $num > self::TOUCH_UDF_COUNT) { |
83
|
|
|
throw new LiftSdkException('Argument $num must be greater than 0 and smaller or equal to 20.'); |
84
|
|
|
} |
85
|
|
|
if (!is_string($value)) { |
86
|
|
|
throw new LiftSdkException('Argument $value must be an instance of string.'); |
87
|
|
|
} |
88
|
|
|
$this['event_udf'.$num] = $value; |
89
|
|
|
|
90
|
|
|
return $this; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Sets the 'event_name' parameter. |
95
|
|
|
* |
96
|
|
|
* @param string $eventName Event name corresponding to the captured information - the event type matching this |
97
|
|
|
* event name must match the master list of events created in Acquia Lift Web |
98
|
|
|
* |
99
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
100
|
|
|
* |
101
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
102
|
|
|
*/ |
103
|
|
|
public function setEventName($eventName) |
104
|
|
|
{ |
105
|
|
|
if (!is_string($eventName)) { |
106
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
107
|
|
|
} |
108
|
|
|
$this['event_name'] = $eventName; |
109
|
|
|
|
110
|
|
|
return $this; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Sets the 'event_source' parameter. |
115
|
|
|
* |
116
|
|
|
* @param string $eventSource Source of the event - can be used to pass event data from tools you have set up to |
117
|
|
|
* send data to Acquia Lift Web (the default Acquia Lift Web value is web; depending on |
118
|
|
|
* your website's configuration, examples may include csrtool1 and promo1) |
119
|
|
|
* |
120
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
121
|
|
|
* |
122
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
123
|
|
|
*/ |
124
|
|
|
public function setEventSource($eventSource) |
125
|
|
|
{ |
126
|
|
|
if (!is_string($eventSource)) { |
127
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
128
|
|
|
} |
129
|
|
|
$this['event_source'] = $eventSource; |
130
|
|
|
|
131
|
|
|
return $this; |
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* Sets the 'event_date' parameter. |
136
|
|
|
* |
137
|
|
|
* @param DateTime $eventDate |
138
|
|
|
* |
139
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
140
|
|
|
* |
141
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
142
|
|
|
*/ |
143
|
|
|
public function setEventDate(DateTime $eventDate) |
144
|
|
|
{ |
145
|
|
|
// The ISO8601 DateTime format is not compatible with ISO-8601, but is left this way for backward compatibility |
146
|
|
|
// reasons. Use DateTime::ATOM or DATE_ATOM for compatibility with ISO-8601 instead. |
147
|
|
|
// See http://php.net/manual/en/class.datetime.php |
148
|
|
|
$this['event_date'] = $eventDate->format(DateTime::ATOM); |
149
|
|
|
|
150
|
|
|
return $this; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* Sets the 'identities' parameter. |
155
|
|
|
* |
156
|
|
|
* @param array $identities Additional identity information |
157
|
|
|
* |
158
|
|
|
* Example of how to structure the $identities parameter: |
159
|
|
|
* <code> |
160
|
|
|
* $options = [ |
161
|
|
|
* '[email protected]' => 'email', |
162
|
|
|
* 'John Smith' => 'name', |
163
|
|
|
* ]; |
164
|
|
|
* </code> |
165
|
|
|
* |
166
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
167
|
|
|
* |
168
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
169
|
|
|
*/ |
170
|
|
|
public function setIdentities(array $identities) |
171
|
|
|
{ |
172
|
|
|
if (Utility::arrayDepth($identities) > 1) { |
173
|
|
|
throw new LiftSdkException('Identities argument is more than 1 level deep.'); |
174
|
|
|
} |
175
|
|
|
$this['identities'] = $identities; |
176
|
|
|
|
177
|
|
|
return $this; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* Sets the 'url' parameter. |
182
|
|
|
* |
183
|
|
|
* @param string $url Event's URL |
184
|
|
|
* |
185
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
186
|
|
|
* |
187
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
188
|
|
|
*/ |
189
|
|
View Code Duplication |
public function setUrl($url) |
190
|
|
|
{ |
191
|
|
|
if (!is_string($url)) { |
192
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
193
|
|
|
} |
194
|
|
|
$this['url'] = $url; |
195
|
|
|
|
196
|
|
|
return $this; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* Sets the 'referral_url' parameter. |
201
|
|
|
* |
202
|
|
|
* @param string $referralUrl Referrer's URL |
203
|
|
|
* |
204
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
205
|
|
|
* |
206
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
207
|
|
|
*/ |
208
|
|
|
public function setReferralUrl($referralUrl) |
209
|
|
|
{ |
210
|
|
|
if (!is_string($referralUrl)) { |
211
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
212
|
|
|
} |
213
|
|
|
$this['referral_url'] = $referralUrl; |
214
|
|
|
|
215
|
|
|
return $this; |
216
|
|
|
} |
217
|
|
|
|
218
|
|
|
/** |
219
|
|
|
* Sets the 'content_title' parameter. |
220
|
|
|
* |
221
|
|
|
* @param string $contentTitle Page title |
222
|
|
|
* |
223
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
224
|
|
|
* |
225
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
226
|
|
|
*/ |
227
|
|
|
public function setContentTitle($contentTitle) |
228
|
|
|
{ |
229
|
|
|
if (!is_string($contentTitle)) { |
230
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
231
|
|
|
} |
232
|
|
|
$this['content_title'] = $contentTitle; |
233
|
|
|
|
234
|
|
|
return $this; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* Sets the 'user_agent' parameter. |
239
|
|
|
* |
240
|
|
|
* @param string $userAgent Visitor's user agent |
241
|
|
|
* |
242
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
243
|
|
|
* |
244
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
245
|
|
|
*/ |
246
|
|
|
public function setUserAgent($userAgent) |
247
|
|
|
{ |
248
|
|
|
if (!is_string($userAgent)) { |
249
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
250
|
|
|
} |
251
|
|
|
$this['user_agent'] = $userAgent; |
252
|
|
|
|
253
|
|
|
return $this; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* Sets the 'platform' parameter. |
258
|
|
|
* |
259
|
|
|
* @param string $platform Visitor's platform |
260
|
|
|
* |
261
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
262
|
|
|
* |
263
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
264
|
|
|
*/ |
265
|
|
|
public function setPlatform($platform) |
266
|
|
|
{ |
267
|
|
|
if (!is_string($platform)) { |
268
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
269
|
|
|
} |
270
|
|
|
$this['platform'] = $platform; |
271
|
|
|
|
272
|
|
|
return $this; |
273
|
|
|
} |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* Sets the 'ip_address' parameter. |
277
|
|
|
* |
278
|
|
|
* @param string $ipAddress Visitor's IP address (supports both IPv4 and IPv6 addresses) |
279
|
|
|
* |
280
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
281
|
|
|
* |
282
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
283
|
|
|
*/ |
284
|
|
|
public function setIpAddress($ipAddress) |
285
|
|
|
{ |
286
|
|
|
if (!is_string($ipAddress)) { |
287
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
288
|
|
|
} |
289
|
|
|
$this['ip_address'] = $ipAddress; |
290
|
|
|
|
291
|
|
|
return $this; |
292
|
|
|
} |
293
|
|
|
|
294
|
|
|
/** |
295
|
|
|
* Sets the 'persona' parameter. |
296
|
|
|
* |
297
|
|
|
* @param string $persona User-defined category into which a visitor fits, based on their viewing of particular |
298
|
|
|
* content |
299
|
|
|
* |
300
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
301
|
|
|
* |
302
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
303
|
|
|
*/ |
304
|
|
|
public function setPersona($persona) |
305
|
|
|
{ |
306
|
|
|
if (!is_string($persona)) { |
307
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
308
|
|
|
} |
309
|
|
|
$this['persona'] = $persona; |
310
|
|
|
|
311
|
|
|
return $this; |
312
|
|
|
} |
313
|
|
|
|
314
|
|
|
/** |
315
|
|
|
* Sets the 'engagement_score' parameter. |
316
|
|
|
* |
317
|
|
|
* @param int $engagementScore The number that you have chosen to signify the importance of a visitor's interest in |
318
|
|
|
* an event |
319
|
|
|
* |
320
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
321
|
|
|
* |
322
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
323
|
|
|
*/ |
324
|
|
|
public function setEngagementScore($engagementScore) |
325
|
|
|
{ |
326
|
|
|
if (!is_integer($engagementScore)) { |
327
|
|
|
throw new LiftSdkException('Argument must be an instance of integer.'); |
328
|
|
|
} |
329
|
|
|
$this['engagement_score'] = $engagementScore; |
330
|
|
|
|
331
|
|
|
return $this; |
332
|
|
|
} |
333
|
|
|
|
334
|
|
|
/** |
335
|
|
|
* Sets the 'personalization_name' parameter. |
336
|
|
|
* |
337
|
|
|
* @param string $personalizationName Name of personalization associated with an event |
338
|
|
|
* |
339
|
|
|
* @deprecated Only used in Lift 2. For Lift 3, please use fields with prefix decision |
340
|
|
|
* |
341
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
342
|
|
|
* |
343
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
344
|
|
|
*/ |
345
|
|
|
public function setPersonalizationName($personalizationName) |
346
|
|
|
{ |
347
|
|
|
if (!is_string($personalizationName)) { |
348
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
349
|
|
|
} |
350
|
|
|
$this['personalization_name'] = $personalizationName; |
351
|
|
|
|
352
|
|
|
return $this; |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* Sets the 'personalization_machine_name' parameter. |
357
|
|
|
* |
358
|
|
|
* @param string $personalizationMachineName Machine name of personalization associated with an event |
359
|
|
|
* |
360
|
|
|
* @deprecated Only used in Lift 2. For Lift 3, please use fields with prefix decision |
361
|
|
|
* |
362
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
363
|
|
|
* |
364
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
365
|
|
|
*/ |
366
|
|
|
public function setPersonalizationMachineName($personalizationMachineName) |
367
|
|
|
{ |
368
|
|
|
if (!is_string($personalizationMachineName)) { |
369
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
370
|
|
|
} |
371
|
|
|
$this['personalization_machine_name'] = $personalizationMachineName; |
372
|
|
|
|
373
|
|
|
return $this; |
374
|
|
|
} |
375
|
|
|
|
376
|
|
|
/** |
377
|
|
|
* Sets the 'personalization_chosen_variation' parameter. |
378
|
|
|
* |
379
|
|
|
* @param string $personalizationChosenVariation The variation (decision) chosen for an event |
380
|
|
|
* |
381
|
|
|
* @deprecated Only used in Lift 2. For Lift 3, please use fields with prefix decision |
382
|
|
|
* |
383
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
384
|
|
|
* |
385
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
386
|
|
|
*/ |
387
|
|
|
public function setPersonalizationChosenVariation($personalizationChosenVariation) |
388
|
|
|
{ |
389
|
|
|
if (!is_string($personalizationChosenVariation)) { |
390
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
391
|
|
|
} |
392
|
|
|
$this['personalization_chosen_variation'] = $personalizationChosenVariation; |
393
|
|
|
|
394
|
|
|
return $this; |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
/** |
398
|
|
|
* Sets the 'personalization_audience_name' parameter. |
399
|
|
|
* |
400
|
|
|
* @param string $personalizationAudienceName The name of the audience |
401
|
|
|
* |
402
|
|
|
* @deprecated Only used in Lift 2. For Lift 3, please use fields with prefix decision |
403
|
|
|
* |
404
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
405
|
|
|
* |
406
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
407
|
|
|
*/ |
408
|
|
|
public function setPersonalizationAudienceName($personalizationAudienceName) |
409
|
|
|
{ |
410
|
|
|
if (!is_string($personalizationAudienceName)) { |
411
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
412
|
|
|
} |
413
|
|
|
$this['personalization_audience_name'] = $personalizationAudienceName; |
414
|
|
|
|
415
|
|
|
return $this; |
416
|
|
|
} |
417
|
|
|
|
418
|
|
|
/** |
419
|
|
|
* Sets the 'personalization_decision_policy' parameter. |
420
|
|
|
* |
421
|
|
|
* @param string $personalizationDecisionPolicy The decision policy used - for example, explore or target |
422
|
|
|
* |
423
|
|
|
* @deprecated Only used in Lift 2. For Lift 3, please use fields with prefix decision |
424
|
|
|
* |
425
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
426
|
|
|
* |
427
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
428
|
|
|
*/ |
429
|
|
|
public function setPersonalizationDecisionPolicy($personalizationDecisionPolicy) |
430
|
|
|
{ |
431
|
|
|
if (!is_string($personalizationDecisionPolicy)) { |
432
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
433
|
|
|
} |
434
|
|
|
$this['personalization_decision_policy'] = $personalizationDecisionPolicy; |
435
|
|
|
|
436
|
|
|
return $this; |
437
|
|
|
} |
438
|
|
|
|
439
|
|
|
/** |
440
|
|
|
* Sets the 'personalization_goal_name' parameter. |
441
|
|
|
* |
442
|
|
|
* @param string $personalizationGoalName The name of the goal reached |
443
|
|
|
* |
444
|
|
|
* @deprecated Only used in Lift 2. For Lift 3, please use fields with prefix decision |
445
|
|
|
* |
446
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
447
|
|
|
* |
448
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
449
|
|
|
*/ |
450
|
|
|
public function setPersonalizationGoalName($personalizationGoalName) |
451
|
|
|
{ |
452
|
|
|
if (!is_string($personalizationGoalName)) { |
453
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
454
|
|
|
} |
455
|
|
|
$this['personalization_goal_name'] = $personalizationGoalName; |
456
|
|
|
|
457
|
|
|
return $this; |
458
|
|
|
} |
459
|
|
|
|
460
|
|
|
/** |
461
|
|
|
* Sets the 'personalization_goal_value' parameter. |
462
|
|
|
* |
463
|
|
|
* @param string $personalizationGoalValue The value of the goal reached |
464
|
|
|
* |
465
|
|
|
* @deprecated Only used in Lift 2. For Lift 3, please use fields with prefix decision |
466
|
|
|
* |
467
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
468
|
|
|
* |
469
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
470
|
|
|
*/ |
471
|
|
|
public function setPersonalizationGoalValue($personalizationGoalValue) |
472
|
|
|
{ |
473
|
|
|
if (!is_string($personalizationGoalValue)) { |
474
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
475
|
|
|
} |
476
|
|
|
$this['personalization_goal_value'] = $personalizationGoalValue; |
477
|
|
|
|
478
|
|
|
return $this; |
479
|
|
|
} |
480
|
|
|
|
481
|
|
|
/** |
482
|
|
|
* Sets the 'decision_slot_id' parameter. |
483
|
|
|
* |
484
|
|
|
* @param string $decisionSlotId Decision Slot Id |
485
|
|
|
* |
486
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
487
|
|
|
* |
488
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
489
|
|
|
*/ |
490
|
|
|
public function setDecisionSlotId($decisionSlotId) |
491
|
|
|
{ |
492
|
|
|
if (!is_string($decisionSlotId)) { |
493
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
494
|
|
|
} |
495
|
|
|
$this['decision_slot_id'] = $decisionSlotId; |
496
|
|
|
|
497
|
|
|
return $this; |
498
|
|
|
} |
499
|
|
|
|
500
|
|
|
/** |
501
|
|
|
* Sets the 'decision_slot_name' parameter. |
502
|
|
|
* |
503
|
|
|
* @param string $decisionSlotName Decision Slot Name |
504
|
|
|
* |
505
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
506
|
|
|
* |
507
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
508
|
|
|
*/ |
509
|
|
|
public function setDecisionSlotName($decisionSlotName) |
510
|
|
|
{ |
511
|
|
|
if (!is_string($decisionSlotName)) { |
512
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
513
|
|
|
} |
514
|
|
|
$this['decision_slot_name'] = $decisionSlotName; |
515
|
|
|
|
516
|
|
|
return $this; |
517
|
|
|
} |
518
|
|
|
|
519
|
|
|
/** |
520
|
|
|
* Sets the 'decision_rule_id' parameter. |
521
|
|
|
* |
522
|
|
|
* @param string $decisionRuleId Decision Slot Name |
523
|
|
|
* |
524
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
525
|
|
|
* |
526
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
527
|
|
|
*/ |
528
|
|
|
public function setDecisionRuleId($decisionRuleId) |
529
|
|
|
{ |
530
|
|
|
if (!is_string($decisionRuleId)) { |
531
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
532
|
|
|
} |
533
|
|
|
$this['decision_rule_id'] = $decisionRuleId; |
534
|
|
|
|
535
|
|
|
return $this; |
536
|
|
|
} |
537
|
|
|
|
538
|
|
|
/** |
539
|
|
|
* Sets the 'decision_rule_name' parameter. |
540
|
|
|
* |
541
|
|
|
* @param string $decisionRuleName Decision Slot Name |
542
|
|
|
* |
543
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
544
|
|
|
* |
545
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
546
|
|
|
*/ |
547
|
|
|
public function setDecisionRuleName($decisionRuleName) |
548
|
|
|
{ |
549
|
|
|
if (!is_string($decisionRuleName)) { |
550
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
551
|
|
|
} |
552
|
|
|
$this['decision_rule_name'] = $decisionRuleName; |
553
|
|
|
|
554
|
|
|
return $this; |
555
|
|
|
} |
556
|
|
|
|
557
|
|
|
/** |
558
|
|
|
* Sets the 'decision_content_id' parameter. |
559
|
|
|
* |
560
|
|
|
* @param string $decisionContentId Decision Content Id |
561
|
|
|
* |
562
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
563
|
|
|
* |
564
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
565
|
|
|
*/ |
566
|
|
|
public function setDecisionContentId($decisionContentId) |
567
|
|
|
{ |
568
|
|
|
if (!is_string($decisionContentId)) { |
569
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
570
|
|
|
} |
571
|
|
|
$this['decision_content_id'] = $decisionContentId; |
572
|
|
|
|
573
|
|
|
return $this; |
574
|
|
|
} |
575
|
|
|
|
576
|
|
|
/** |
577
|
|
|
* Sets the 'decision_content_name' parameter. |
578
|
|
|
* |
579
|
|
|
* @param string $decisionContentName Decision Content Name |
580
|
|
|
* |
581
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
582
|
|
|
* |
583
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
584
|
|
|
*/ |
585
|
|
|
public function setDecisionContentName($decisionContentName) |
586
|
|
|
{ |
587
|
|
|
if (!is_string($decisionContentName)) { |
588
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
589
|
|
|
} |
590
|
|
|
$this['decision_content_name'] = $decisionContentName; |
591
|
|
|
|
592
|
|
|
return $this; |
593
|
|
|
} |
594
|
|
|
|
595
|
|
|
/** |
596
|
|
|
* Sets the 'decision_goal_id' parameter. |
597
|
|
|
* |
598
|
|
|
* @param string $decisionGoalId Decision Goal Id |
599
|
|
|
* |
600
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
601
|
|
|
* |
602
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
603
|
|
|
*/ |
604
|
|
|
public function setDecisionGoalId($decisionGoalId) |
605
|
|
|
{ |
606
|
|
|
if (!is_string($decisionGoalId)) { |
607
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
608
|
|
|
} |
609
|
|
|
$this['decision_goal_id'] = $decisionGoalId; |
610
|
|
|
|
611
|
|
|
return $this; |
612
|
|
|
} |
613
|
|
|
|
614
|
|
|
/** |
615
|
|
|
* Sets the 'decision_goal_name' parameter. |
616
|
|
|
* |
617
|
|
|
* @param string $decisionGoalName Decision Goal Name |
618
|
|
|
* |
619
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
620
|
|
|
* |
621
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
622
|
|
|
*/ |
623
|
|
|
public function setDecisionGoalName($decisionGoalName) |
624
|
|
|
{ |
625
|
|
|
if (!is_string($decisionGoalName)) { |
626
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
627
|
|
|
} |
628
|
|
|
$this['decision_goal_name'] = $decisionGoalName; |
629
|
|
|
|
630
|
|
|
return $this; |
631
|
|
|
} |
632
|
|
|
|
633
|
|
|
/** |
634
|
|
|
* Sets the 'decision_goal_value' parameter. |
635
|
|
|
* |
636
|
|
|
* @param string $decisionGoalValue Decision Goal Value |
637
|
|
|
* |
638
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
639
|
|
|
* |
640
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
641
|
|
|
*/ |
642
|
|
|
public function setDecisionGoalValue($decisionGoalValue) |
643
|
|
|
{ |
644
|
|
|
if (!is_string($decisionGoalValue)) { |
645
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
646
|
|
|
} |
647
|
|
|
$this['decision_goal_value'] = $decisionGoalValue; |
648
|
|
|
|
649
|
|
|
return $this; |
650
|
|
|
} |
651
|
|
|
|
652
|
|
|
/** |
653
|
|
|
* Sets the 'decision_view_mode' parameter. |
654
|
|
|
* |
655
|
|
|
* @param string $decisionViewMode Decision View Mode |
656
|
|
|
* |
657
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
658
|
|
|
* |
659
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
660
|
|
|
*/ |
661
|
|
|
public function setDecisionViewMode($decisionViewMode) |
662
|
|
|
{ |
663
|
|
|
if (!is_string($decisionViewMode)) { |
664
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
665
|
|
|
} |
666
|
|
|
$this['decision_view_mode'] = $decisionViewMode; |
667
|
|
|
|
668
|
|
|
return $this; |
669
|
|
|
} |
670
|
|
|
|
671
|
|
|
/** |
672
|
|
|
* Sets the 'decision_policy' parameter. |
673
|
|
|
* |
674
|
|
|
* @param string $decisionPolicy The decision policy used - for example, explore or target |
675
|
|
|
* |
676
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
677
|
|
|
* |
678
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
679
|
|
|
*/ |
680
|
|
|
public function setDecisionPolicy($decisionPolicy) |
681
|
|
|
{ |
682
|
|
|
if (!is_string($decisionPolicy)) { |
683
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
684
|
|
|
} |
685
|
|
|
$this['decision_policy'] = $decisionPolicy; |
686
|
|
|
|
687
|
|
|
return $this; |
688
|
|
|
} |
689
|
|
|
|
690
|
|
|
/** |
691
|
|
|
* Sets the 'capture_identifier' parameter. |
692
|
|
|
* |
693
|
|
|
* @param string $captureIdentifier Unique identifier for the capture |
694
|
|
|
* |
695
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
696
|
|
|
* |
697
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
698
|
|
|
*/ |
699
|
|
|
public function setCaptureIdentifier($captureIdentifier) |
700
|
|
|
{ |
701
|
|
|
if (!is_string($captureIdentifier)) { |
702
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
703
|
|
|
} |
704
|
|
|
$this['capture_identifier'] = $captureIdentifier; |
705
|
|
|
|
706
|
|
|
return $this; |
707
|
|
|
} |
708
|
|
|
|
709
|
|
|
/** |
710
|
|
|
* Sets the 'client_timezone' parameter. |
711
|
|
|
* |
712
|
|
|
* @param string $clientTimezone Client Timezone |
713
|
|
|
* |
714
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
715
|
|
|
* |
716
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
717
|
|
|
*/ |
718
|
|
|
public function setClientTimezone($clientTimezone) |
719
|
|
|
{ |
720
|
|
|
if (!is_string($clientTimezone)) { |
721
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
722
|
|
|
} |
723
|
|
|
$this['client_timezone'] = $clientTimezone; |
724
|
|
|
|
725
|
|
|
return $this; |
726
|
|
|
} |
727
|
|
|
|
728
|
|
|
/** |
729
|
|
|
* Sets the 'javascript_version' parameter. |
730
|
|
|
* |
731
|
|
|
* @param string $javascriptVersion version of the javascript that generated the capture |
732
|
|
|
* |
733
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
734
|
|
|
* |
735
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
736
|
|
|
*/ |
737
|
|
|
public function setJavascriptVersion($javascriptVersion) |
738
|
|
|
{ |
739
|
|
|
if (!is_string($javascriptVersion)) { |
740
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
741
|
|
|
} |
742
|
|
|
$this['javascript_version'] = $javascriptVersion; |
743
|
|
|
|
744
|
|
|
return $this; |
745
|
|
|
} |
746
|
|
|
|
747
|
|
|
/** |
748
|
|
|
* Sets the 'post_id' parameter. |
749
|
|
|
* |
750
|
|
|
* @param string $postId Post id of an article |
751
|
|
|
* |
752
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
753
|
|
|
* |
754
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
755
|
|
|
*/ |
756
|
|
|
public function setPostId($postId) |
757
|
|
|
{ |
758
|
|
|
if (!is_string($postId)) { |
759
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
760
|
|
|
} |
761
|
|
|
$this['post_id'] = $postId; |
762
|
|
|
|
763
|
|
|
return $this; |
764
|
|
|
} |
765
|
|
|
|
766
|
|
|
/** |
767
|
|
|
* Sets the 'content_id' parameter. |
768
|
|
|
* |
769
|
|
|
* @param string $contentId Content id of an article |
770
|
|
|
* |
771
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
772
|
|
|
* |
773
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
774
|
|
|
*/ |
775
|
|
|
public function setContentId($contentId) |
776
|
|
|
{ |
777
|
|
|
if (!is_string($contentId)) { |
778
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
779
|
|
|
} |
780
|
|
|
$this['content_id'] = $contentId; |
781
|
|
|
|
782
|
|
|
return $this; |
783
|
|
|
} |
784
|
|
|
|
785
|
|
|
/** |
786
|
|
|
* Sets the 'content_type' parameter. |
787
|
|
|
* |
788
|
|
|
* @param string $contentType Content-type to which a piece of visitor-viewed content belongs |
789
|
|
|
* |
790
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
791
|
|
|
* |
792
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
793
|
|
|
*/ |
794
|
|
|
public function setContentType($contentType) |
795
|
|
|
{ |
796
|
|
|
if (!is_string($contentType)) { |
797
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
798
|
|
|
} |
799
|
|
|
$this['content_type'] = $contentType; |
800
|
|
|
|
801
|
|
|
return $this; |
802
|
|
|
} |
803
|
|
|
|
804
|
|
|
/** |
805
|
|
|
* Sets the 'content_section' parameter. |
806
|
|
|
* |
807
|
|
|
* @param string $contentSection Content section of an article |
808
|
|
|
* |
809
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
810
|
|
|
* |
811
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
812
|
|
|
*/ |
813
|
|
|
public function setContentSection($contentSection) |
814
|
|
|
{ |
815
|
|
|
if (!is_string($contentSection)) { |
816
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
817
|
|
|
} |
818
|
|
|
$this['content_section'] = $contentSection; |
819
|
|
|
|
820
|
|
|
return $this; |
821
|
|
|
} |
822
|
|
|
|
823
|
|
|
/** |
824
|
|
|
* Sets the 'content_keywords' parameter. |
825
|
|
|
* |
826
|
|
|
* @param string $contentKeywords Content keywords of an article |
827
|
|
|
* |
828
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
829
|
|
|
* |
830
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
831
|
|
|
*/ |
832
|
|
|
public function setContentKeywords($contentKeywords) |
833
|
|
|
{ |
834
|
|
|
if (!is_string($contentKeywords)) { |
835
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
836
|
|
|
} |
837
|
|
|
$this['content_keywords'] = $contentKeywords; |
838
|
|
|
|
839
|
|
|
return $this; |
840
|
|
|
} |
841
|
|
|
|
842
|
|
|
/** |
843
|
|
|
* Sets the 'author' parameter. |
844
|
|
|
* |
845
|
|
|
* @param string $author Author of an article |
846
|
|
|
* |
847
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
848
|
|
|
* |
849
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
850
|
|
|
*/ |
851
|
|
|
public function setAuthor($author) |
852
|
|
|
{ |
853
|
|
|
if (!is_string($author)) { |
854
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
855
|
|
|
} |
856
|
|
|
$this['author'] = $author; |
857
|
|
|
|
858
|
|
|
return $this; |
859
|
|
|
} |
860
|
|
|
|
861
|
|
|
/** |
862
|
|
|
* Sets the 'page_type' parameter. |
863
|
|
|
* |
864
|
|
|
* @param string $pageType Category of page the visitor viewed (examples include article page, tag page, and home page) |
865
|
|
|
* |
866
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
867
|
|
|
* |
868
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
869
|
|
|
*/ |
870
|
|
|
public function setPageType($pageType) |
871
|
|
|
{ |
872
|
|
|
if (!is_string($pageType)) { |
873
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
874
|
|
|
} |
875
|
|
|
$this['page_type'] = $pageType; |
876
|
|
|
|
877
|
|
|
return $this; |
878
|
|
|
} |
879
|
|
|
|
880
|
|
|
/** |
881
|
|
|
* Sets the 'thumbnail_url' parameter. |
882
|
|
|
* |
883
|
|
|
* @param string $thumbnailUrl Thumbnail URL of an article |
884
|
|
|
* |
885
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
886
|
|
|
* |
887
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
888
|
|
|
*/ |
889
|
|
|
public function setThumbnailUrl($thumbnailUrl) |
890
|
|
|
{ |
891
|
|
|
if (!is_string($thumbnailUrl)) { |
892
|
|
|
throw new LiftSdkException('Argument must be an instance of string.'); |
893
|
|
|
} |
894
|
|
|
$this['thumbnail_url'] = $thumbnailUrl; |
895
|
|
|
|
896
|
|
|
return $this; |
897
|
|
|
} |
898
|
|
|
|
899
|
|
|
/** |
900
|
|
|
* Sets the 'published_date' parameter. |
901
|
|
|
* |
902
|
|
|
* @param DateTime $publishedDate Publish date of an article |
903
|
|
|
* |
904
|
|
|
* @throws \Acquia\LiftClient\Exception\LiftSdkException |
905
|
|
|
* |
906
|
|
|
* @return \Acquia\LiftClient\Entity\Capture |
907
|
|
|
*/ |
908
|
|
|
public function setPublishedDate(DateTime $publishedDate) |
909
|
|
|
{ |
910
|
|
|
// The ISO8601 DateTime format is not compatible with ISO-8601, but is left this way for backward compatibility |
911
|
|
|
// reasons. Use DateTime::ATOM or DATE_ATOM for compatibility with ISO-8601 instead. |
912
|
|
|
// See http://php.net/manual/en/class.datetime.php |
913
|
|
|
$this['published_date'] = $publishedDate->format(DateTime::ATOM); |
914
|
|
|
|
915
|
|
|
return $this; |
916
|
|
|
} |
917
|
|
|
} |
918
|
|
|
|