[英]Google Drive Api - google-apps.document - get modifiedTime
我將Google Drive Api v3與PHP結合使用。 我有一個google文檔-application / vnd.google-apps.document。
如何獲得上次修改時間?
我試過了:
$this->getClient()->files->get($id,[]);
並清空所有詳細信息,如何獲取上次更新日期?
Google_Service_Drive_DriveFile {#1362 ▼
#collection_key: "spaces"
+appProperties: null
#capabilitiesType: "Google_Service_Drive_DriveFileCapabilities"
#capabilitiesDataType: ""
#contentHintsType: "Google_Service_Drive_DriveFileContentHints"
#contentHintsDataType: ""
+createdTime: null
+description: null
+explicitlyTrashed: null
+fileExtension: null
+folderColorRgb: null
+fullFileExtension: null
+headRevisionId: null
+iconLink: null
+id: "1WoKgfNSFN1sIDqbLNahTMe4Ds8rNygt2E8AkUcbO1qM"
#imageMediaMetadataType: "Google_Service_Drive_DriveFileImageMediaMetadata"
#imageMediaMetadataDataType: ""
+isAppAuthorized: null
+kind: "drive#file"
#lastModifyingUserType: "Google_Service_Drive_User"
#lastModifyingUserDataType: ""
+md5Checksum: null
+mimeType: "application/vnd.google-apps.document"
+modifiedByMeTime: null
+modifiedTime: null
+name: "+ 4.4 Szkolenia żeglarskie, REJSY SZKOLENIOWE"
+originalFilename: null
+ownedByMe: null
#ownersType: "Google_Service_Drive_User"
#ownersDataType: "array"
+parents: null
#permissionsType: "Google_Service_Drive_Permission"
#permissionsDataType: "array"
+properties: null
+quotaBytesUsed: null
+shared: null
+sharedWithMeTime: null
#sharingUserType: "Google_Service_Drive_User"
#sharingUserDataType: ""
+size: null
+spaces: null
+starred: null
+thumbnailLink: null
+trashed: null
+version: null
#videoMediaMetadataType: "Google_Service_Drive_DriveFileVideoMediaMetadata"
#videoMediaMetadataDataType: ""
+viewedByMe: null
+viewedByMeTime: null
+viewersCanCopyContent: null
+webContentLink: null
+webViewLink: null
+writersCanShare: null
#internal_gapi_mappings: []
#modelData: []
#processed: []
}
還有另一種獲取日期的方法嗎?
您應指定所需的字段,然后嘗試
$response = $this->service->files->get($fileId, array(
'fields' => 'id, name, modifiedTime',
// uncomment the following if you are working with team drive
//'supportsTeamDrives' => true
));
print_r($response);
我希望這個能幫上忙
看看我的git存儲庫中的一些有用功能https://github.com/sazaamout/gDrive/blob/master/gDrive.php
請查看以下鏈接以獲取更多信息https://developers.google.com/drive/v3/web/search-parameters#file_fields
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.