|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the xAPI package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Christian Flothmann <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Xabbuh\XApi\Model; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* xAPI context activities. |
|
16
|
|
|
* |
|
17
|
|
|
* @author Christian Flothmann <[email protected]> |
|
18
|
|
|
*/ |
|
19
|
|
|
final class ContextActivities |
|
20
|
|
|
{ |
|
21
|
|
|
private $parentActivity; |
|
22
|
|
|
private $groupingActivity; |
|
23
|
|
|
private $categoryActivity; |
|
24
|
|
|
private $otherActivity; |
|
25
|
|
|
|
|
26
|
|
|
public function __construct(Activity $parentActivity = null, Activity $groupingActivity = null, Activity $categoryActivity = null, Activity $otherActivity = null) |
|
27
|
|
|
{ |
|
28
|
|
|
$this->parentActivity = $parentActivity; |
|
29
|
|
|
$this->groupingActivity = $groupingActivity; |
|
30
|
|
|
$this->categoryActivity = $categoryActivity; |
|
31
|
|
|
$this->otherActivity = $otherActivity; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function withParentActivity(Activity $parentActivity) |
|
35
|
|
|
{ |
|
36
|
|
|
$contextActivities = clone $this; |
|
37
|
|
|
$contextActivities->parentActivity = $parentActivity; |
|
38
|
|
|
|
|
39
|
|
|
return $contextActivities; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function withGroupingActivity(Activity $groupingActivity) |
|
43
|
|
|
{ |
|
44
|
|
|
$contextActivities = clone $this; |
|
45
|
|
|
$contextActivities->groupingActivity = $groupingActivity; |
|
46
|
|
|
|
|
47
|
|
|
return $contextActivities; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function withCategoryActivity(Activity $categoryActivity) |
|
51
|
|
|
{ |
|
52
|
|
|
$contextActivities = clone $this; |
|
53
|
|
|
$contextActivities->categoryActivity = $categoryActivity; |
|
54
|
|
|
|
|
55
|
|
|
return $contextActivities; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
public function withOtherActivity(Activity $otherActivity) |
|
59
|
|
|
{ |
|
60
|
|
|
$contextActivities = clone $this; |
|
61
|
|
|
$contextActivities->otherActivity = $otherActivity; |
|
62
|
|
|
|
|
63
|
|
|
return $contextActivities; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
public function getParentActivity() |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->parentActivity; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
public function getGroupingActivity() |
|
72
|
|
|
{ |
|
73
|
|
|
return $this->groupingActivity; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function getCategoryActivity() |
|
77
|
|
|
{ |
|
78
|
|
|
return $this->categoryActivity; |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
public function getOtherActivity() |
|
82
|
|
|
{ |
|
83
|
|
|
return $this->otherActivity; |
|
84
|
|
|
} |
|
85
|
|
|
} |
|
86
|
|
|
|