Completed
Pull Request — master (#7)
by Nick
14:05
created

Capture::setTouchUdf()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 15
Code Lines 9

Duplication

Lines 15
Ratio 100 %

Importance

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