Skip to content

Commit c89f38a

Browse files
committed
Examples updated
1 parent 2c1017f commit c89f38a

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

examples/SharePoint/Fields/CreateIndex.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22

3+
/**
4+
* Creates an index to a list
5+
* Adding an index to a list or library column increases performance when you use filters
6+
*/
7+
38
require_once '../../vendor/autoload.php';
49
$settings = include('../../../tests/Settings.php');
510

@@ -11,13 +16,17 @@
1116
$ctx = (new ClientContext($siteUrl))->withCredentials($credentials);
1217
$fieldName = "Modified";
1318

14-
1519
$list = $ctx->getWeb()->getLists()->getByTitle("Contacts_Large");
1620

1721
//ensure index for a field
1822
$field = $list->getFields()->getByInternalNameOrTitle($fieldName)->get()->executeQuery();
1923
if(!$field->getIndexed()){
24+
print("Enabling index for a field :" . $fieldName . PHP_EOL);
2025
$result = $field->enableIndex()->executeQuery();
26+
print("Done" . PHP_EOL);
27+
}
28+
else{
29+
print("Index has already been enabled for a field: " . $fieldName . PHP_EOL);
2130
}
2231

2332

examples/SharePoint/Taxonomy/ExportTax.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
$settings = include('../../../tests/Settings.php');
1111
$appPrincipal = new ClientCredential($settings['ClientId'],$settings['ClientSecret']);
1212
$ctx = (new ClientContext($settings['Url']))->withCredentials($appPrincipal);
13-
$taxSvc = new TaxonomyService($ctx);
14-
$groups = $taxSvc->getTermStore()->getTermGroups()->get()->executeQuery();
13+
$groups = $ctx->getTaxonomy()->getTermStore()->getTermGroups()->get()->executeQuery();
1514

16-
$fp = fopen('./SiteTaxonomy.csv', 'w');
15+
$fp = fopen('./Taxonomy.csv', 'w');
1716

1817
/** @var TermGroup $group */
1918
foreach ($groups as $group){

src/Runtime/CSOM/CSOMRequest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use Office365\Runtime\ClientRequest;
77
use Office365\Runtime\Http\RequestOptions;
8+
use Office365\Runtime\Http\Response;
89

910
class CSOMRequest extends ClientRequest
1011
{
@@ -22,8 +23,9 @@ class CSOMRequest extends ClientRequest
2223

2324
/**
2425
* Submit client request(s) to Office 365 API OData/SOAP service
26+
* @param $query
2527
*/
26-
public function executeQuery()
28+
public function executeQuery($query)
2729
{
2830
// TODO: Implement executeQuery() method.
2931
}
@@ -53,18 +55,20 @@ protected function setRequestHeaders(RequestOptions $request)
5355
}
5456

5557
/**
56-
* @param $response
58+
* @param Response $response
59+
* @param $query
5760
*/
58-
public function processResponse($response)
61+
public function processResponse($response, $query)
5962
{
6063
// TODO: Implement processResponse() method.
6164
}
6265

6366
/**
6467
* Build Client Request
68+
* @param $query
6569
* @return void
6670
*/
67-
public function buildRequest()
71+
public function buildRequest($query)
6872
{
6973
// TODO: Implement buildRequest() method.
7074
}

src/Runtime/ClientObject.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ public function ensureProperty($propName, $loadedCallback=null)
318318
* Ensure properties are loaded
319319
* @param array $propNames
320320
* @param callable $loadedCallback
321+
* @return self
321322
*/
322323
public function ensureProperties($propNames, $loadedCallback=null){
323324

0 commit comments

Comments
 (0)