Reputation: 1414
i have a problem, im using this client form my app to google drive api.
but the problem is i cant check if the files is trashed
or not.
here what i try
$client = new \Google_Client();
$client->setScopes(\Google_Service_Drive::DRIVE);
$client->setAuthConfig(app_path().'/Credentials/gDrive.json');
$service = new \Google_Service_Drive($client);
$folder = $service->files->get("fileid");
this always return trashed as null, what ever it trashed or not..
Upvotes: 2
Views: 1699
Reputation: 201603
I believe your goal and your current situation as follows.
fields
. In your case, if you want to check only trashed
, you can use trashed
as the fields.When this is reflected to your script, it becomes as follows.
$folder = $service->files->get("fileid");
To:
$folder = $service->files->get("fileid", array("fields" => "trashed"));
$trashed = $folder['trashed'] ? "true" : "false";
echo $trashed;
fileid
is put in "Trash", $trashed
is true
.fileid
is NOT put in "Trash", $trashed
is false
."fields" => "*"
instead of "fields" => "trashed"
.Upvotes: 2