-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathClientResult.php
69 lines (54 loc) · 1.22 KB
/
ClientResult.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace Office365\Runtime;
use Office365\Runtime\Http\RequestOptions;
/**
* Represents a Service Operation result.
*/
class ClientResult
{
/**
*
* @param ClientRuntimeContext $ctx
* @param ClientObject|ClientValue|int|bool|string|null $returnValue
*/
function __construct($ctx, $returnValue=null)
{
$this->context = $ctx;
$this->value = $returnValue;
}
public function setProperty($key, $value){
if($this->value instanceof ClientObject || $this->value instanceof ClientValue) {
$this->value->setProperty($key,$value,False);
}
else {
$this->value = $value;
}
}
/**
* @return RequestOptions
*/
public function buildRequest(){
return $this->context->buildRequest();
}
/**
* @return $this
*/
public function executeQuery(){
$this->context->executeQuery();
return $this;
}
/**
* @return bool|int|string|ClientObject|ClientValue|null
*/
public function getValue(){
return $this->value;
}
/**
* @var $value
*/
protected $value;
/**
* @var ClientRuntimeContext
*/
protected $context;
}