I want to get a list of Files that are missing for a SilverStripe report.
The filesize is not directly stored in the database, instead I have to call method getSize()
If I try to iterate through the records and just choose the empty records, I only get the first level of the file hierarchy
$all_files = File::get()->sort('FileFilename');
$list = new ArrayList();
foreach ($all_files as $file) {
$file->mysize = $file->getSize();
if($file->getSize() == "" && $file->ClassName != 'SilverStripe\Assets\Folder'){
$list->push($file);
}
}
return $list;
How can I get all the records that are empty files?