【发布时间】:2016-12-23 12:30:16
【问题描述】:
我将 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: []
}
还有其他方法可以得到这个日期吗?
【问题讨论】:
-
正如我所读到的here,Drive API v3 默认不再返回完整资源。使用fields query parameter 请求返回特定字段。您也可以查看related thread。
标签: php google-drive-api google-docs-api