Skip to content

Commit 62fb425

Browse files
committedFeb 5, 2022
Optimize odata request payload serializing, fixes for saving multi-choice field value (#261)
1 parent 04a2b2c commit 62fb425

27 files changed

+290
-95
lines changed
 

‎examples/SharePoint/ListItems/SetLookupFieldValue.php ‎examples/SharePoint/ListItems/SetFieldValues.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Office365\Runtime\Auth\ClientCredential;
88
use Office365\SharePoint\ClientContext;
99
use Office365\SharePoint\FieldLookupValue;
10+
use Office365\SharePoint\FieldMultiChoiceValue;
1011
use Office365\SharePoint\FieldMultiLookupValue;
1112
use Office365\SharePoint\FieldUserValue;
1213
use Office365\SharePoint\ListItem;
@@ -28,6 +29,7 @@
2829
'Title' => "New task N#" . rand(1, 100000),
2930
'ParentTask' => new FieldLookupValue($taskId),
3031
'PrimaryManager' => new FieldUserValue($me->getId()),
31-
'Managers' => new FieldMultiLookupValue([$me->getId()])
32+
'Managers' => new FieldMultiLookupValue([$me->getId()]),
33+
'TaskCategories' => new FieldMultiChoiceValue(["Event", "Reminder"])
3234
);
3335
$item = $list->addItem($taskProps)->executeQuery();

‎src/Outlook/OutlookItem.php

+2-8
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ class OutlookItem extends Entity
1414
*/
1515
public function getChangeKey()
1616
{
17-
if (!$this->isPropertyAvailable("ChangeKey")) {
18-
return null;
19-
}
20-
return $this->getProperty("ChangeKey");
17+
return $this->getProperty("ChangeKey", null);
2118
}
2219
/**
2320
* @var string
@@ -31,10 +28,7 @@ public function setChangeKey($value)
3128
*/
3229
public function getCategories()
3330
{
34-
if (!$this->isPropertyAvailable("Categories")) {
35-
return null;
36-
}
37-
return $this->getProperty("Categories");
31+
return $this->getProperty("Categories", null);
3832
}
3933
/**
4034
* @var array

‎src/Runtime/ClientObject.php

+3-11
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,6 @@ public function getParentCollection()
127127
return $this->parentCollection;
128128
}
129129

130-
/**
131-
* @return null
132-
*/
133-
protected function getServerTypeId()
134-
{
135-
return null;
136-
}
137-
138130

139131
/**
140132
* @return ClientRuntimeContext
@@ -211,11 +203,11 @@ public function select($value)
211203

212204
/**
213205
* Gets entity type name
214-
* @return string
206+
* @return ServerTypeInfo
215207
*/
216-
public function getServerTypeName()
208+
public function getServerTypeInfo()
217209
{
218-
return null;
210+
return ServerTypeInfo::resolve($this);
219211
}
220212

221213
/**

‎src/Runtime/ClientResult.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function executeQuery(){
5050

5151

5252
/**
53-
* @return bool|int|ClientObject|ClientValue|string|null
53+
* @return bool|int|string|ClientObject|ClientValue|null
5454
*/
5555
public function getValue(){
5656
return $this->value;

‎src/Runtime/ClientValue.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public function getProperty($name, $defaultValue=null)
5151

5252

5353
/**
54-
* @return string
54+
* @return ServerTypeInfo
5555
*/
56-
public function getServerTypeName()
56+
public function getServerTypeInfo()
5757
{
58-
return null;
58+
return ServerTypeInfo::resolve($this);
5959
}
6060

6161
/**

‎src/Runtime/ClientValueCollection.php

+3-10
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function fromArray($itemTypeName,$values)
3030

3131
/**
3232
* Adds property to collection
33-
* @param ClientValue $value
33+
* @param ClientValue|string $value
3434
*/
3535
public function addChild($value)
3636
{
@@ -81,19 +81,12 @@ public function createType()
8181
*/
8282
function getItemTypeName()
8383
{
84-
if(isset($this->itemTypeName))
84+
if(isset($this->itemTypeName)) {
8585
return $this->itemTypeName;
86+
}
8687
return str_replace("Collection","",get_class($this));
8788
}
8889

89-
/**
90-
* @return string|null
91-
*/
92-
public function getServerTypeName()
93-
{
94-
return null;
95-
}
96-
9790
/**
9891
* @return array
9992
*/

‎src/Runtime/OData/ODataRequest.php

+6-27
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,8 @@ public function buildRequest(){
7575
*/
7676
public function normalizeTypeName($type)
7777
{
78-
$collection = false;
79-
$typeName = $type->getServerTypeName();
80-
if (is_null($typeName)) {
81-
82-
if ($type instanceof ClientValueCollection) {
83-
$collection = true;
84-
$typeInfo = explode("\\", $type->getItemTypeName());
85-
}
86-
else{
87-
$typeInfo = explode("\\", get_class($type));
88-
}
89-
$typeName = end($typeInfo);
90-
91-
//if ($this->context instanceof OutlookClient)
92-
// $typeName = "#Microsoft.OutlookServices.$typeName";
93-
if ($this->context instanceof ClientContext)
94-
$typeName = "SP.$typeName";
95-
else if ($this->context instanceof GraphServiceClient) {
96-
$typeName = lcfirst($typeName);
97-
$typeName = "microsoft.graph.$typeName";
98-
}
99-
return $collection ? "Collection($typeName)" : $typeName;
100-
}
101-
return $typeName;
78+
$typeInfo = $type->getServerTypeInfo()->patch($this->context);
79+
return (string)$typeInfo;
10280
}
10381

10482

@@ -119,8 +97,8 @@ protected function normalizePayload($value,ODataFormat $format)
11997
return $this->normalizePayload($property,$format);
12098
}, $value->toJson(true));
12199

122-
if(!($value instanceof ClientValueCollection || $value instanceof ClientObjectCollection))
123-
$this->ensureAnnotation($value,$json,$format);
100+
101+
$this->ensureAnnotation($value,$json,$format);
124102
return $json;
125103
} else if (is_array($value)) {
126104
return array_map(function ($item) use($format){
@@ -147,7 +125,8 @@ protected function ensureAnnotation($type, &$json,$format)
147125
}
148126
}
149127
elseif ($format instanceof JsonFormat){
150-
$json[$format->TypeTag] = "$typeName";
128+
if(!($type instanceof ClientValueCollection))
129+
$json[$format->TypeTag] = "$typeName";
151130
}
152131
}
153132

‎src/Runtime/ServerTypeInfo.php

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?php
2+
3+
namespace Office365\Runtime;
4+
5+
use Exception;
6+
use Office365\GraphServiceClient;
7+
use Office365\SharePoint\ClientContext;
8+
9+
class ServerTypeInfo
10+
{
11+
12+
/**
13+
* @param string $namespace
14+
* @param string $name
15+
* @param boolean $collection
16+
*/
17+
public function __construct($namespace = null, $name = null, $collection=false)
18+
{
19+
$this->Namespace = $namespace;
20+
$this->Name = $name;
21+
$this->Id = null;
22+
$this->Collection = $collection;
23+
}
24+
25+
/**
26+
* @param string $value
27+
* @return ServerTypeInfo
28+
*/
29+
public static function fromFullName($value){
30+
$parts = explode(".", $value);
31+
$typeName = end($parts);
32+
$namespace = implode(".", array_slice($parts, 0,-1));
33+
return new ServerTypeInfo($namespace, $typeName);
34+
}
35+
36+
/**
37+
* @return ServerTypeInfo
38+
* @throws Exception
39+
*/
40+
public static function primitive($typeName, $isCollection = false)
41+
{
42+
if (array_key_exists($typeName, self::$PrimitiveTypeMappings)) {
43+
$primitiveTypeName = self::$PrimitiveTypeMappings[$typeName];
44+
return new ServerTypeInfo("Edm", $primitiveTypeName, $isCollection);
45+
}
46+
throw new Exception("Unknown primitive type: $typeName");
47+
}
48+
49+
/**
50+
* @param ClientValue|ClientObject $type
51+
* @return ServerTypeInfo
52+
*/
53+
public static function resolve($type)
54+
{
55+
if($type instanceof ClientValueCollection || $type instanceof ClientObjectCollection){
56+
$itemTypeName = $type->getItemTypeName();
57+
$collection = true;
58+
}
59+
else {
60+
$itemTypeName = get_class($type);
61+
$collection = false;
62+
}
63+
$parts = explode("\\", $itemTypeName);
64+
$typeName = end($parts);
65+
//$namespace = implode(".", array_slice($parts, 1, count($parts) - 2));
66+
return new ServerTypeInfo(null, $typeName, $collection);
67+
}
68+
69+
/**
70+
* @param ClientRuntimeContext $context
71+
*/
72+
public function patch($context){
73+
if ($context instanceof ClientContext) {
74+
if(is_null($this->Namespace)) $this->Namespace = "SP";
75+
}
76+
else if ($context instanceof GraphServiceClient) {
77+
if(is_null($this->Namespace)) $this->Namespace = "microsoft.graph";
78+
$this->Name = lcfirst($this->Name);
79+
}
80+
return $this;
81+
}
82+
83+
public function __toString()
84+
{
85+
$fullName = "$this->Namespace.$this->Name";
86+
return $this->Collection ? "Collection($fullName)" : $fullName;
87+
}
88+
89+
90+
/**
91+
* @var string
92+
*/
93+
public $Id;
94+
95+
/**
96+
* @var string
97+
*/
98+
public $Namespace;
99+
100+
/**
101+
* @var string
102+
*/
103+
public $Name;
104+
105+
106+
/**
107+
* @var boolean
108+
*/
109+
public $Collection;
110+
111+
/**
112+
* @var string[]
113+
*/
114+
static $PrimitiveTypeMappings = array(
115+
"string" => "String",
116+
"bool" => "Boolean",
117+
"integer" => "Int32",
118+
"double" => "Double"
119+
);
120+
121+
}

‎src/SharePoint/ContentTypeCreationInformation.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Office365\SharePoint;
55
use Office365\Runtime\ClientValue;
6+
use Office365\Runtime\ServerTypeInfo;
67

78
/**
89
* Specifies properties that are used as parameters to initialize a new content type.
@@ -15,9 +16,12 @@ public function __construct()
1516
}
1617

1718

18-
public function getServerTypeName()
19+
/**
20+
* @return ServerTypeInfo
21+
*/
22+
public function getServerTypeInfo()
1923
{
20-
return "SP.ContentType";
24+
return new ServerTypeInfo("SP", "ContentType");
2125
}
2226

2327

‎src/SharePoint/FieldCreationInformation.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Office365\SharePoint;
77

88
use Office365\Runtime\ClientValue;
9+
use Office365\Runtime\ServerTypeInfo;
10+
911
/**
1012
* Represents properties that can be set when creating a field.
1113
*/
@@ -16,9 +18,12 @@ public function __construct()
1618
parent::__construct();
1719
}
1820

19-
public function getServerTypeName()
21+
/**
22+
* @return ServerTypeInfo
23+
*/
24+
public function getServerTypeInfo()
2025
{
21-
return "SP.Field";
26+
return new ServerTypeInfo("SP", "Field");
2227
}
2328

2429
/**
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Office365\SharePoint;
4+
5+
use Office365\Runtime\ClientValueCollection;
6+
use Office365\Runtime\ServerTypeInfo;
7+
8+
class FieldMultiChoiceValue extends ClientValueCollection
9+
{
10+
11+
/**
12+
* @param string[] $choices
13+
*/
14+
public function __construct($choices)
15+
{
16+
parent::__construct("string");
17+
foreach ($choices as $choice) {
18+
$this->addChild($choice);
19+
}
20+
}
21+
22+
public function toJson()
23+
{
24+
return array('results' => $this->getData());
25+
}
26+
27+
public function getServerTypeInfo()
28+
{
29+
return ServerTypeInfo::primitive("string",true);
30+
}
31+
32+
}

‎src/SharePoint/FieldMultiLookupValue.php

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Office365\SharePoint;
44

55
use Office365\Runtime\ClientValueCollection;
6+
use Office365\Runtime\ServerTypeInfo;
67

78
class FieldMultiLookupValue extends ClientValueCollection
89
{
@@ -23,4 +24,12 @@ public function toJson()
2324
return array('results' => $lookupIds);
2425
}
2526

27+
/**
28+
* @return ServerTypeInfo
29+
*/
30+
public function getServerTypeInfo()
31+
{
32+
return ServerTypeInfo::primitive("integer", true);
33+
}
34+
2635
}

‎src/SharePoint/Folder.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public function rename($name)
9292
$item = $this->getListItemAllFields();
9393
$item->setProperty('Title', $name);
9494
$item->setProperty('FileLeafRef', $name);
95-
$qry = new UpdateEntityQuery($item);
96-
$this->getContext()->addQueryAndResultObject($qry, $this);
95+
$item->update();
9796
return $this;
9897
}
9998
/**

‎src/SharePoint/GroupCreationInformation.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Office365\SharePoint;
55
use Office365\Runtime\ClientValue;
6+
use Office365\Runtime\ServerTypeInfo;
67

78
/**
89
* An object used to facilitate creation of a cross-site group.
@@ -27,9 +28,12 @@ public function __construct($title)
2728
parent::__construct();
2829
}
2930

30-
public function getServerTypeName()
31+
/**
32+
* @return ServerTypeInfo
33+
*/
34+
public function getServerTypeInfo()
3135
{
32-
return "SP.Group";
36+
return new ServerTypeInfo("SP", "Group");
3337
}
3438

3539
}

‎src/SharePoint/ListCreationInformation.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Office365\SharePoint;
77

88
use Office365\Runtime\ClientValue;
9+
use Office365\Runtime\ServerTypeInfo;
10+
911
class ListCreationInformation extends ClientValue
1012
{
1113
/**
@@ -47,9 +49,12 @@ public function __construct($title)
4749
parent::__construct();
4850
}
4951

50-
public function getServerTypeName()
52+
/**
53+
* @return ServerTypeInfo
54+
*/
55+
public function getServerTypeInfo()
5156
{
52-
return "SP.List";
57+
return new ServerTypeInfo("SP", "List");
5358
}
5459

5560
}

‎src/SharePoint/ListItem.php

+16-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Office365\SharePoint;
77

88
use Office365\Runtime\ResourcePath;
9+
use Office365\Runtime\ServerTypeInfo;
10+
911
/**
1012
* Specifies
1113
* a list
@@ -422,9 +424,12 @@ public function getFieldValuesForEdit()
422424
}
423425

424426

425-
public function getServerTypeName()
427+
/**
428+
* @return ServerTypeInfo
429+
*/
430+
public function getServerTypeInfo()
426431
{
427-
return $this->typeName;
432+
return ServerTypeInfo::fromFullName($this->typeName);
428433
}
429434

430435

@@ -444,6 +449,15 @@ public function setProperty($name, $value, $persistChanges = true)
444449
return $this;
445450
}
446451

452+
/**
453+
* @return ListItem
454+
*/
455+
public function update()
456+
{
457+
$this->ensureTypeName($this->getParentList());
458+
return parent::update();
459+
}
460+
447461
/**
448462
* @var string
449463
*/

‎src/SharePoint/Portal/SPSiteCreationRequest.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
namespace Office365\SharePoint\Portal;
44

55
use Office365\Runtime\ClientValue;
6+
use Office365\Runtime\ServerTypeInfo;
67

78
class SPSiteCreationRequest extends ClientValue
89
{
910

10-
function getServerTypeName()
11+
/**
12+
* @return ServerTypeInfo
13+
*/
14+
function getServerTypeInfo()
1115
{
12-
return "Microsoft.SharePoint.Portal.SPSiteCreationRequest";
16+
return new ServerTypeInfo("Microsoft.SharePoint.Portal", "SPSiteCreationRequest");
1317
}
1418

1519
/**

‎src/SharePoint/Portal/SPSiteCreationResponse.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
namespace Office365\SharePoint\Portal;
44

55
use Office365\Runtime\ClientValue;
6+
use Office365\Runtime\ServerTypeInfo;
67

78
class SPSiteCreationResponse extends ClientValue
89
{
9-
function getServerTypeName()
10+
/**
11+
* @return ServerTypeInfo
12+
*/
13+
function getServerTypeInfo()
1014
{
11-
return "Microsoft.SharePoint.Portal.SPSiteCreationResponse";
15+
return new ServerTypeInfo("Microsoft.SharePoint.Portal", "SPSiteCreationResponse");
1216
}
1317

1418

‎src/SharePoint/Portal/SPSiteManager.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Office365\Runtime\Actions\InvokePostMethodQuery;
88
use Office365\Runtime\ClientResult;
99
use Office365\Runtime\ResourcePath;
10+
use Office365\Runtime\ServerTypeInfo;
1011
use Office365\SharePoint\BaseEntity;
1112
use Office365\SharePoint\ClientContext;
1213

@@ -55,9 +56,12 @@ public function delete($siteId){
5556
}
5657

5758

58-
public function getServerTypeName()
59+
/**
60+
* @return ServerTypeInfo
61+
*/
62+
public function getServerTypeInfo()
5963
{
60-
return "Microsoft.SharePoint.Portal.SPSiteManager";
64+
return new ServerTypeInfo("Microsoft.SharePoint.Portal", "SPSiteManager");
6165
}
6266

6367
}

‎src/SharePoint/Publishing/VideoChannel.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Office365\Runtime\ClientObject;
99
use Office365\Runtime\ResourcePath;
10+
use Office365\Runtime\ServerTypeInfo;
1011

1112
class VideoChannel extends ClientObject
1213
{
@@ -51,9 +52,13 @@ public function getVideos()
5152
{
5253
return new VideoCollection($this->getContext(), new ResourcePath("Videos", $this->getResourcePath()));
5354
}
54-
public function getServerTypeName()
55+
56+
/**
57+
* @return ServerTypeInfo
58+
*/
59+
public function getServerTypeInfo()
5560
{
56-
return implode(".", array("SP", "Publishing", parent::getServerTypeName()));
61+
return new ServerTypeInfo("SP.Publishing", "VideoChannel");
5762
}
5863
/**
5964
* @return bool

‎src/SharePoint/Publishing/VideoItem.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Office365\Runtime\ResourcePath;
99
use Office365\Runtime\Http\HttpMethod;
1010
use Office365\Runtime\Http\RequestOptions;
11+
use Office365\Runtime\ServerTypeInfo;
1112
use Office365\SharePoint\ClientContext;
1213
use Office365\SharePoint\Entity;
1314

@@ -42,9 +43,13 @@ function setProperty($name, $value, $persistChanges = true)
4243
}
4344
parent::setProperty($name, $value, $persistChanges);
4445
}
45-
public function getServerTypeName()
46+
47+
/**
48+
* @return ServerTypeInfo
49+
*/
50+
public function getServerTypeInfo()
4651
{
47-
return implode(".", array("SP", "Publishing", parent::getServerTypeName()));
52+
return new ServerTypeInfo("SP.Publishing", "VideoItem");
4853
}
4954
/**
5055
* @return string

‎src/SharePoint/SPList.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use Office365\Runtime\Actions\InvokePostMethodQuery;
1111
use Office365\Runtime\ResourcePath;
1212
use Office365\Runtime\ResourcePathServiceOperation;
13+
use Office365\Runtime\ServerTypeInfo;
14+
1315
/**
1416
* Specifies
1517
* a list
@@ -143,9 +145,13 @@ public function getParentWeb()
143145
{
144146
return $this->getProperty("ParentWeb", new Web($this->getContext(), new ResourcePath("ParentWeb", $this->getResourcePath())));
145147
}
146-
public function getServerTypeName()
148+
149+
/**
150+
* @return ServerTypeInfo
151+
*/
152+
public function getServerTypeInfo()
147153
{
148-
return "SP.List";
154+
return new ServerTypeInfo("SP", "List");
149155
}
150156
/**
151157
* @return bool

‎src/SharePoint/Search/SearchRequest.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55

66

77
use Office365\Runtime\ClientValue;
8+
use Office365\Runtime\ServerTypeInfo;
89

910
class SearchRequest extends ClientValue
1011
{
1112

1213
/**
13-
* @return string
14+
* @return ServerTypeInfo
1415
*/
15-
public function getServerTypeName()
16+
public function getServerTypeInfo()
1617
{
17-
return "Microsoft.Office.Server.Search.REST.SearchRequest";
18+
return new ServerTypeInfo("Microsoft.Office.Server.Search.REST", "SearchRequest");
1819
}
1920

2021
/**

‎src/SharePoint/Search/SearchResult.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@
55

66

77
use Office365\Runtime\ClientValue;
8+
use Office365\Runtime\ServerTypeInfo;
89

910
class SearchResult extends ClientValue
1011
{
1112

1213

13-
public function getServerTypeName()
14+
/**
15+
* @return ServerTypeInfo
16+
*/
17+
public function getServerTypeInfo()
1418
{
15-
return "Microsoft.Office.Server.Search.REST.SearchResult";
19+
return new ServerTypeInfo("Microsoft.Office.Server.Search.REST", "SearchResult");
1620
}
1721

1822
}

‎src/SharePoint/Taxonomy/TaxonomySession.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getTaxonomySession(ClientRuntimeContext $ctx)
2828
if(is_null($ctx))
2929
throw new InvalidArgumentException("Context is not initialized");
3030
$qry = new InvokePostMethodQuery($this, null, "GetTaxonomySession", null,null);
31-
$qry->TypeId = $this->getServerTypeId();
31+
$qry->TypeId = $this->getServerTypeInfo()->Id;
3232
$qry->IsStatic = true;
3333
$taxonomySession = new TaxonomySession($ctx);
3434
$this->context->addQuery($qry);

‎src/SharePoint/UserProfiles/ProfileLoader.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Office365\Runtime\Actions\InvokePostMethodQuery;
99
use Office365\Runtime\ClientRuntimeContext;
1010
use Office365\Runtime\ResourcePath;
11+
use Office365\Runtime\ServerTypeInfo;
1112
use Office365\SharePoint\BaseEntity;
1213

1314
class ProfileLoader extends BaseEntity
@@ -31,9 +32,12 @@ public static function getProfileLoader(ClientRuntimeContext $context)
3132
return $loader;
3233
}
3334

34-
function getServerTypeName()
35+
/**
36+
* @return ServerTypeInfo
37+
*/
38+
function getServerTypeInfo()
3539
{
36-
return "SP.UserProfiles.ProfileLoader";
40+
return new ServerTypeInfo("SP.UserProfiles", "ProfileLoader");
3741
}
3842

3943
}

‎src/SharePoint/ViewCreationInformation.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Office365\SharePoint;
77

88
use Office365\Runtime\ClientValue;
9+
use Office365\Runtime\ServerTypeInfo;
10+
911
/**
1012
* Specifies
1113
* the properties used to create a new list view.
@@ -50,9 +52,12 @@ public function __construct()
5052
parent::__construct();
5153
}
5254

53-
public function getServerTypeName()
55+
/**
56+
* @return ServerTypeInfo
57+
*/
58+
public function getServerTypeInfo()
5459
{
55-
return "SP.View";
60+
return new ServerTypeInfo("SP", "View");
5661
}
5762

5863
public $baseViewId;

0 commit comments

Comments
 (0)
Please sign in to comment.