Get IDs of files in a FileSet
Permalink 1 user found helpful
I am trying to get an array of IDs of files in a fileset. Does anyone have a method to do this?
Thanks
Thanks
I saw this but I'm more interested in how to do this programmatically seeing as how I am trying to use the file ID's in a block I am creating.
This should really be part of the FileSet model.. to return an array of Files within, but I digress. Here's what I use:
Loader::model('file_set'); Loader::model('file_list'); $fs = FileSet::getByName('My Fileset'); $fileList = new FileList(); $fileList->filterBySet($fs); $files = $fileList->get(); foreach ($files as $file) { // do things here .. or not }
http://www.concrete5.org/marketplace/addons/list-files-from-set/...