Skip to content

Commit c5e0101

Browse files
committed
New methods have been introduced for Web object
1 parent b05be0e commit c5e0101

40 files changed

+169
-71
lines changed

examples/Settings.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

33
$Settings = array(
4-
'Url' => "https://mediadev23.sharepoint.com",
5-
'OneDriveUrl' => "https://mediadev23-my.SharePoint.com",
4+
'Url' => "https://mediadev88.sharepoint.com",
5+
'OneDriveUrl' => "https://mediadev88-my.SharePoint.com",
66
'Password' => "P@ssw0rd",
7-
'UserName' => "mattim@mediadev23.onmicrosoft.com"
7+
'UserName' => "mattim@mediadev88.onmicrosoft.com"
88
);
99

1010
$AppSettings = array(
11-
'TenantName' => "mediadev23.onmicrosoft.com",
11+
'TenantName' => "mediadev88.onmicrosoft.com",
1212
'ClientId' => "d426369e-c84b-47db-b6b1-b9c824ac2ea2",
1313
'ClientSecret' => "wrizJBW41]|=@govNEDR059",
1414
'Title' => "Office365 Graph explorer",
-18.1 KB
Binary file not shown.
-18.1 KB
Binary file not shown.

src/OutlookServices/Message.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function reply($comment)
2121
{
2222
$parameter = new ClientValueObject();
2323
$parameter->setProperty("Comment",$comment);
24-
$qry = new InvokePostMethodQuery($this,"Reply",null,$parameter);
24+
$qry = new InvokePostMethodQuery($this->getResourcePath(),"Reply",null,$parameter);
2525
$this->getContext()->addQuery($qry);
2626
}
2727

@@ -34,7 +34,7 @@ public function replyAll($comment)
3434
{
3535
$parameter = new ClientValueObject();
3636
$parameter->setProperty("Comment",$comment);
37-
$qry = new InvokePostMethodQuery($this,"ReplyAll",null,$parameter);
37+
$qry = new InvokePostMethodQuery($this->getResourcePath(),"ReplyAll",null,$parameter);
3838
$this->getContext()->addQuery($qry);
3939
}
4040

@@ -49,7 +49,7 @@ public function forward($comment,$toRecipients)
4949
$parameter = new ClientValueObject();
5050
$parameter->setProperty("Comment",$comment);
5151
$parameter->setProperty("ToRecipients",$toRecipients);
52-
$qry = new InvokePostMethodQuery($this,"Forward",null,$parameter);
52+
$qry = new InvokePostMethodQuery($this->getResourcePath(),"Forward",null,$parameter);
5353
$this->getContext()->addQuery($qry);
5454
}
5555

@@ -62,7 +62,7 @@ public function forward($comment,$toRecipients)
6262
public function move($destinationId){
6363
$parameter = new ClientValueObject();
6464
$parameter->setProperty("DestinationId",$destinationId);
65-
$qry = new InvokePostMethodQuery($this,"Move",null,$parameter);
65+
$qry = new InvokePostMethodQuery($this->getResourcePath(),"Move",null,$parameter);
6666
$this->getContext()->addQuery($qry);
6767
}
6868

src/OutlookServices/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function sendEmail(Message $message, $saveToSentItems)
7575
$payload = new ClientValueObject();
7676
$payload->setProperty("Message", $message);
7777
$payload->setProperty("SaveToSentItems", $saveToSentItems);
78-
$action = new InvokePostMethodQuery($this, "SendMail",null,$payload);
78+
$action = new InvokePostMethodQuery($this->getResourcePath(), "SendMail",null,$payload);
7979
$this->getContext()->addQuery($action);
8080
}
8181

src/Runtime/Auth/SamlTokenProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ public function getAuthenticationCookie()
5353
return 'FedAuth=' . $this->FedAuth . '; rtFa=' . $this->rtFa;
5454
}
5555

56-
5756

57+
/**
58+
* @param $parameters
59+
* @throws Exception
60+
*/
5861
public function acquireToken($parameters)
5962
{
6063
$token = $this->acquireSecurityToken($parameters['username'], $parameters['password']);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
4+
namespace Office365\PHP\Client\Runtime;
5+
6+
7+
class ContextResourcePath extends ResourcePath
8+
{
9+
10+
public function __construct(ClientRuntimeContext $context)
11+
{
12+
parent::__construct($context);
13+
}
14+
15+
16+
/**
17+
* @return string
18+
*/
19+
public function toString()
20+
{
21+
return null;
22+
}
23+
}

src/Runtime/CreateEntityQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CreateEntityQuery extends InvokePostMethodQuery
1212
*/
1313
public function __construct(ClientObject $entityCollection, ClientObject $entity)
1414
{
15-
parent::__construct($entityCollection,null,null,$entity);
15+
parent::__construct($entityCollection->getResourcePath(),null,null,$entity);
1616
}
1717

1818
}

src/Runtime/DeleteEntityQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ class DeleteEntityQuery extends InvokePostMethodQuery
1313
*/
1414
public function __construct(ClientObject $clientObject)
1515
{
16-
parent::__construct($clientObject);
16+
parent::__construct($clientObject->getResourcePath());
1717
}
1818
}

src/Runtime/InvokeMethodQuery.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ class InvokeMethodQuery extends ClientAction
1111

1212
/**
1313
* InvokeMethodQuery constructor.
14-
* @param ClientObject $parentClientObject
14+
* @param ResourcePath $resourcePath
1515
* @param string $methodName
1616
* @param array|ISchemaType $methodParameters
1717
*/
18-
public function __construct(ClientObject $parentClientObject, $methodName=null, $methodParameters=null)
18+
public function __construct(ResourcePath $resourcePath, $methodName=null, $methodParameters=null)
1919
{
2020

2121
$path = new ResourcePathServiceOperation(
22-
$parentClientObject->getContext(),
23-
$parentClientObject->getResourcePath(),
22+
$resourcePath->getContext(),
23+
$resourcePath,
2424
$methodName,
2525
$methodParameters
2626
);

0 commit comments

Comments
 (0)