The FileSet object is to Files what the Group object is to Users. Files can appear in more than one set. Additionally, when advanced permissions are enabled, file sets themselves may have their own permissions, specifying which users and groups may search them, add to them, and edit files within them.
$fs = FileSet::getGlobal();
This returns the global file set object. All files belong to this set implicitly, although it's mostly for permissions concerns.
$files = FileSet::getMySets($user = false)
Returns an array of FileSet objects that belong to the user, OR are public. If a user object isn't passed, the current logged-in user will be used.
$fs = FileSet::getByID($fsID)
Returns a FileSet object by its ID.
$fs = FileSet::getByName($fsName)
Returns a FileSet object by its name.
Returns the ID of a file set.
Returns the name of a file set.
$fs = FileSet::createAndGetSet($name, $type, $uID = false)
Creates a new file set if set doesn't exist. Type may be one of the following
FileSet::TYPE_PRIVATE FileSet::TYPE_PUBLIC FileSet::TYPE_STARRED
$fsf = $fs->addFileToSet($f)
Adds a file to a file set. $f may either be an instance of the File object or a file ID. Returns a FileSetFile object.
Removes a file from a file set.
Resets permissions on a file set.
Returns true if the fileset overrides the global file permissions.
$fs->setPermissions($obj, $canSearch, $canRead, $canWrite, $canAdmin, $canAdd, $extensions = array())
Sets up a permissions record on the current FileSet object. $obj may be an instance of the UserInfo or Group class. All arguments beginning with $can should be one of the following permissions levels:
FilePermissions::PTYPE_NONE FilePermissions::PTYPE_MINE FilePermissions::PTYPE_ALL FilePermissions::PTYPE_CUSTOM