nao-pon/flysystem-google-drive

Why listContents locks $query?

Closed this issue · 3 comments

Why listContents hides $maxResults and $queryarguments?

I'd like to list all folders, including "shared with me", but thanks to this limitation I need to extend GoogleDriveAdapter only to overload listContents with those hidden arguments. Is there any reason behind this? Or should I feel free to send PR's? :)

Also listContents does a array_values over protected listItems, which also returns array_values. Is this neccessary?

@mrblur With FlySystem's API, you can specify only the directory name and Boolean value of recursion for the argument of listContents (). Therefore, I think that it is good to be able to set the target items by the option received in the constructor. I always welcome your PR to make it possible.

And array_values() in listContents() is unnecessary. I will fix it.

Thanks! 👍

@nao-pon You are right, I missed the Flysystems interface part as my app is focused on GDrive.
The correct way to add own $query would be to overload Adapter.

However, I have forked and changed the way $parameters are handled inside getItems. I am going to use team drives, so I would need to apply all that teamDriveId, supportsTeamDrive and includeTeamDriveItems inside getItems.
I am going to PR with extended default options and new protected method, so one could change those parameters inside own Adapter, and also, configure globally for selected team drive.