Skip to content

Commit 2e0cfa2

Browse files
committed
added file methods
1 parent 4bce6e9 commit 2e0cfa2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Resources/Files.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
class Files extends MsGraph
99
{
10-
public function getFiles($path = null)
10+
public function getFiles($path = null, $order = 'asc')
1111
{
12-
$path = $path === null ? 'me/drive/root/children?$orderby=name%20asc' : 'me/drive/root:'.$this->forceStartingSlash($path).':/children';
12+
$path = $path === null ? "me/drive/root/children?\$orderby=name%20$order" : "me/drive/root:".$this->forceStartingSlash($path).':/children?\$orderby=name%20$order';
1313
return MsGraph::get($path);
1414
}
1515

@@ -40,7 +40,7 @@ public function deleteFile($id)
4040
return MsGraph::delete("me/drive/items/$id");
4141
}
4242

43-
public function createFolder($name, $path)
43+
public function createFolder($name, $path = null)
4444
{
4545
$path = $path === null ? 'me/drive/root/children' : 'me/drive/root:'.$this->forceStartingSlash($path).':/children';
4646
return MsGraph::post($path, [
@@ -97,15 +97,14 @@ public function upload($name, $uploadPath, $path = null)
9797
];
9898

9999
$client = new Client;
100-
$response = $client->put($uploadUrl, [
100+
$client->put($uploadUrl, [
101101
'headers' => $headers,
102102
'body' => $data,
103103
]);
104104

105105
$bytesRemaining = $bytesRemaining - $chunkSize;
106106
$i++;
107107
}
108-
109108
}
110109

111110
protected function createUploadSession($name, $path = null)

0 commit comments

Comments
 (0)