Get user's file set
Permalink
Hi all
I'm creating a file set when a user is created like this:
The last argument is the user's ID, which makes them the owner of the file set. How do I then get all filesets that are owned by that user?
I've tried FileSet::getMySets($user_id) but that returns both the filesets owned by the user (which is what I want) and any public sets, which I don't want.
Is there any way to show only the sets owned by the user, ignoring the public ones? The getMySets method seems pretty useless if it includes public sets.
I'm creating a file set when a user is created like this:
Events::extend('on_user_add', function($arg){ FileSet::createAndGetSet($arg->uName, FileSet::TYPE_PUBLIC, $arg->uID); });
The last argument is the user's ID, which makes them the owner of the file set. How do I then get all filesets that are owned by that user?
I've tried FileSet::getMySets($user_id) but that returns both the filesets owned by the user (which is what I want) and any public sets, which I don't want.
Is there any way to show only the sets owned by the user, ignoring the public ones? The getMySets method seems pretty useless if it includes public sets.
/models/file_set.php
The database query just looks for filesets with the uID field the same as the passed user ID, so only sets belonging to them are returned.