-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathViewCollection.php
60 lines (51 loc) · 1.53 KB
/
ViewCollection.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
<?php
namespace Office365\SharePoint;
use Office365\Runtime\Actions\InvokePostMethodQuery;
use Office365\Runtime\ClientObject;
use Office365\Runtime\ClientRuntimeContext;
use Office365\Runtime\Paths\ServiceOperationPath;
use Office365\Runtime\ResourcePath;
class ViewCollection extends BaseEntityCollection
{
public function __construct(ClientRuntimeContext $ctx, ?ResourcePath $resourcePath = null, ?ClientObject $parent = null)
{
parent::__construct($ctx, $resourcePath, View::class, $parent);
}
/**
* Get View by title
* @param $title
* @return View
*/
public function getByTitle($title)
{
return new View(
$this->getContext(),
new ServiceOperationPath("getByTitle",array(rawurlencode($title)),$this->getResourcePath())
);
}
/**
* Get View by id
* @param $id
* @return View
*/
public function getById($id)
{
return new View(
$this->getContext(),
new ServiceOperationPath("getById",array($id),$this->getResourcePath())
);
}
/**
* Creates a View resource
* @param ViewCreationInformation $properties
* @return View
*/
public function add(ViewCreationInformation $properties)
{
$view = new View($this->getContext(),$this->getResourcePath());
$qry = new InvokePostMethodQuery($this,null,null,null,$properties);
$this->getContext()->addQueryAndResultObject($qry,$view);
$this->addChild($view);
return $view;
}
}