-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathRequestContext.php
61 lines (47 loc) · 1.1 KB
/
RequestContext.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
<?php
namespace Office365\Runtime;
use Office365\SharePoint\Site;
use Office365\SharePoint\Web;
class RequestContext extends ClientObject
{
/**
* @var Site
*/
private $site;
/**
* @var Web
*/
private $web;
/**
* @return Site
*/
public function getSite()
{
if(!isset($this->site)){
$this->site = new Site($this->getContext(),new ResourcePath("Site",$this->getResourcePath()));
}
return $this->site;
}
/**
* @return mixed|null|Site
*/
public function getWeb()
{
if(!isset($this->web)){
$this->web = new Web($this->getContext(),new ResourcePath("Web",$this->getResourcePath()));
}
return $this->web;
}
public static function GetCurrent(ClientRuntimeContext $context)
{
static $current = null;
if ($current === null) {
$current = new RequestContext($context,null);
}
return $current;
}
protected function getServerTypeId()
{
return "{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}";
}
}