concrete5/concrete5-5.7.0 — pull request #1297 by mkly (2014-10-08 20:18:43+00:00)
Title: Deal with FileSet::getByName() ambiguity

`FileSet::getByName()` gets the first row matching fsName from the FileSets table
https://github.com/concrete5/concrete5-5.7.0/blob/develop/web/concrete/src/File/Set/Set.php#L187

This is regardless of which uID the file set is attached to. This gets a little awkward because you can have many file sets with the same name.
https://github.com/concrete5/concrete5-5.7.0/blob/develop/web/concrete/src/File/Set/Set.php#L69
Someone was even nice enough to put a note about that :wink:

Which makes me wonder what this will end up returning
https://github.com/concrete5/concrete5-5.7.0/blob/develop/web/concrete/tools/conversations/add_file.php#L156

So I used to use a "global" file set with a uID of 0 in own projects and write a few helper methods to get around the issue. This pull request attempts to come up with a backwards compatible way to deal with the issue. An alternative implementation would be to add a `FileSet::setUserID()` method and use that instead of the additional function parameter. I wasn't quite sure which pattern was currently preferred.

---

Add global uID for global file sets not owned by any user
Add strict check to `FileSet::getMySets() and
`FileSet::createAndGetSet()`
Add optional parameters for uID to `FileSet::getByName()` and
`FileSet::getFilesBySetName()`