Completed
Pull Request — master (#15)
by Christian
04:04
created

Context::getContextActivities()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
 * Contextual information for an xAPI statement.
16
 *
17
 * @author Christian Flothmann <[email protected]>
18
 */
19
final class Context
20
{
21
    private $registration;
22
    private $instructor;
23
    private $team;
24
    private $contextActivities;
25
    private $revision;
26
    private $platform;
27
    private $language;
28
    private $statement;
29
    private $extensions;
30
31
    /**
32
     * @param string $registration
33
     *
34
     * @return self
35
     */
36
    public function withRegistration($registration)
37
    {
38
        $context = clone $this;
39
        $context->registration = $registration;
40
41
        return $context;
42
    }
43
44
    public function withInstructor(Actor $instructor)
45
    {
46
        $context = clone $this;
47
        $context->instructor = $instructor;
48
49
        return $context;
50
    }
51
52
    public function withTeam(Group $team)
53
    {
54
        $context = clone $this;
55
        $context->team = $team;
56
57
        return $context;
58
    }
59
60
    public function withContextActivities(ContextActivities $contextActivities)
61
    {
62
        $context = clone $this;
63
        $context->contextActivities = $contextActivities;
64
65
        return $context;
66
    }
67
68
    /**
69
     * @param string $revision
70
     *
71
     * @return self
72
     */
73
    public function withRevision($revision)
74
    {
75
        $context = clone $this;
76
        $context->revision = $revision;
77
78
        return $context;
79
    }
80
81
    /**
82
     * @param string $platform
83
     *
84
     * @return self
85
     */
86
    public function withPlatform($platform)
87
    {
88
        $context = clone $this;
89
        $context->platform = $platform;
90
91
        return $context;
92
    }
93
94
    /**
95
     * @param string $language
96
     *
97
     * @return self
98
     */
99
    public function withLanguage($language)
100
    {
101
        $context = clone $this;
102
        $context->language = $language;
103
104
        return $context;
105
    }
106
107
    public function withStatement(StatementReference $statement)
108
    {
109
        $context = clone $this;
110
        $context->statement = $statement;
111
112
        return $context;
113
    }
114
115
    public function withExtensions(Extensions $extensions)
116
    {
117
        $context = clone $this;
118
        $context->extensions = $extensions;
119
120
        return $context;
121
    }
122
123
    /**
124
     * @return string|null
125
     */
126
    public function getRegistration()
127
    {
128
        return $this->registration;
129
    }
130
131
    /**
132
     * @return Actor|null
133
     */
134
    public function getInstructor()
135
    {
136
        return $this->instructor;
137
    }
138
139
    /**
140
     * @return Group|null
141
     */
142
    public function getTeam()
143
    {
144
        return $this->team;
145
    }
146
147
    /**
148
     * @return ContextActivities|null
149
     */
150
    public function getContextActivities()
151
    {
152
        return $this->contextActivities;
153
    }
154
155
    /**
156
     * @return string|null
157
     */
158
    public function getRevision()
159
    {
160
        return $this->revision;
161
    }
162
163
    /**
164
     * @return string|null
165
     */
166
    public function getPlatform()
167
    {
168
        return $this->platform;
169
    }
170
171
    /**
172
     * @return string|null
173
     */
174
    public function getLanguage()
175
    {
176
        return $this->language;
177
    }
178
179
    /**
180
     * @return StatementReference|null
181
     */
182
    public function getStatement()
183
    {
184
        return $this->statement;
185
    }
186
187
    /**
188
     * @return Extensions|null
189
     */
190
    public function getExtensions()
191
    {
192
        return $this->extensions;
193
    }
194
}
195