Update an file. This can be e.g. used to rename a file.
Parameters
Name
Type
Description
$id
string
ID of the entry that should be updated.
$update_request
array
The content that should be patched. E.g. ['name' => 'new_name'].
Return
Name
Type
Description
$node
CachedNode
The object for the patched file.
Usage
WPCP_ONEDRIVE_API::set_account_by_id('8c9bacda0-d8d8-4b22-b634-7b5281687575');
WPCP_ONEDRIVE_API::set_drive_by_id('b!DlaHWskCed_MIid3KpJH5Lbatf9HsdXBAZH5YcvPAbMhJUKzTJyzgvXZYpBS');
// Update request to rename, and add a description
$updaterequest = [
'name' => 'Another picture.jpg',
'description' => 'Nunc sit amet convallis ante, nec molestie leo. Duis quis egestas arcu. Sed lacinia imperdiet tellus et molestie. Nulla at ornare diam, ac pretium augue. '
];
// Patch the file or folder
$node = WPCP_ONEDRIVE_API::patch('01EXLSWHWMQZNDMLRG7NFIWAVYCFJAXP2R', $updaterequest);
Parameters
Name
Type
Description
$id
string
ID of the entry that should be updated.
$update_request
UYDGoogle_Service_Drive_DriveFile
An object containing the requested patch.
Return
Name
Type
Description
$node
CachedNode
The object for the patched file.
Usage
WPCP_GDRIVE_API::set_account_by_id('201096615285735764133')
// Update request to rename, and add a description
$update_request = new \UYDGoogle_Service_Drive_DriveFile();
$update_request->setName('Another picture.jpg');
$update_request->setDescription('Nunc sit amet convallis ante, nec molestie leo. Duis quis egestas arcu. Sed lacinia imperdiet tellus et molestie. Nulla at ornare diam, ac pretium augue.');
// Patch the file or folder
$node = WPCP_GDRIVE_API::patch('1wzWlDMsZkA4N5yEEAmMigp52u7M0Lk_7', $update_request);
Not supported
Parameters
Name
Type
Description
$id
string
ID of the entry that should be updated.
$update_request
array
The content that should be patched. E.g. ['name' => 'new_name'].
$is_dir
bool
Is the entry a folder or a file?
Return
Name
Type
Description
$node
CachedNode
The object for the patched file.
Usage
WPCP_BOX_API::set_account_by_id('29232154182');
// Update request to rename, and add a description
$updaterequest = [
'name' => 'Another picture.jpg',
'description' => 'Nunc sit amet convallis ante, nec molestie leo. Duis quis egestas arcu. Sed lacinia imperdiet tellus et molestie. Nulla at ornare diam, ac pretium augue. '
];
// Patch the file or folder
$node = WPCP_BOX_API::patch('51142665', $updaterequest, false);