1 | <?php |
||
19 | final class SubStatement extends Object |
||
20 | { |
||
21 | /** |
||
22 | * @var Verb $verb The {@link Verb} |
||
23 | */ |
||
24 | private $verb; |
||
25 | |||
26 | /** |
||
27 | * @var Actor The {@link Actor} |
||
28 | */ |
||
29 | private $actor; |
||
30 | |||
31 | /** |
||
32 | * @var Object The {@link Object} |
||
33 | */ |
||
34 | private $object; |
||
35 | |||
36 | /** |
||
37 | * @var Result The {@link Activity} {@link Result} |
||
38 | */ |
||
39 | private $result; |
||
40 | |||
41 | /** |
||
42 | * @var Context The {@link Statement} {@link Context} |
||
43 | */ |
||
44 | private $context; |
||
45 | |||
46 | public function __construct(Actor $actor, Verb $verb, Object $object, Result $result = null, Context $context = null) |
||
58 | |||
59 | public function withActor(Actor $actor) |
||
60 | { |
||
61 | $subStatement = clone $this; |
||
62 | $subStatement->actor = $actor; |
||
63 | |||
64 | return $subStatement; |
||
65 | } |
||
66 | |||
67 | public function withVerb(Verb $verb) |
||
68 | { |
||
69 | $subStatement = clone $this; |
||
70 | $subStatement->verb = $verb; |
||
71 | |||
72 | return $subStatement; |
||
73 | } |
||
74 | |||
75 | public function withObject(Object $object) |
||
76 | { |
||
77 | $subStatement = clone $this; |
||
78 | $subStatement->object = $object; |
||
79 | |||
80 | return $subStatement; |
||
81 | } |
||
82 | |||
83 | public function withResult(Result $result) |
||
84 | { |
||
85 | $subStatement = clone $this; |
||
86 | $subStatement->result = $result; |
||
87 | |||
88 | return $subStatement; |
||
89 | } |
||
90 | |||
91 | public function withContext(Context $context) |
||
92 | { |
||
93 | $subStatement = clone $this; |
||
94 | $subStatement->context = $context; |
||
95 | |||
96 | return $subStatement; |
||
97 | } |
||
98 | |||
99 | /** |
||
100 | * Returns the Statement's {@link Verb}. |
||
101 | * |
||
102 | * @return Verb The Verb |
||
103 | */ |
||
104 | public function getVerb() |
||
108 | |||
109 | /** |
||
110 | * Returns the Statement's {@link Actor}. |
||
111 | * |
||
112 | * @return Actor The Actor |
||
113 | */ |
||
114 | public function getActor() |
||
118 | |||
119 | /** |
||
120 | * Returns the Statement's {@link Object}. |
||
121 | * |
||
122 | * @return \Xabbuh\XApi\Model\Object The Object |
||
123 | */ |
||
124 | public function getObject() |
||
128 | |||
129 | /** |
||
130 | * Returns the {@link Activity} {@link Result}. |
||
131 | * |
||
132 | * @return Result The Result |
||
133 | */ |
||
134 | public function getResult() |
||
138 | |||
139 | /** |
||
140 | * Returns the {@link Statement} {@link Context}. |
||
141 | * |
||
142 | * @return Context The Context |
||
143 | */ |
||
144 | public function getContext() |
||
148 | |||
149 | /** |
||
150 | * Tests whether or not this Statement is a void Statement (i.e. it voids |
||
151 | * another Statement). |
||
152 | * |
||
153 | * @return bool True if the Statement voids another Statement, false otherwise |
||
154 | */ |
||
155 | public function isVoidStatement() |
||
159 | |||
160 | /** |
||
161 | * {@inheritdoc} |
||
162 | */ |
||
163 | public function equals(Object $statement) |
||
205 | } |
||
206 |