There was a need to display the size of the downloaded user file, and I have decided it is simple:
SomeFunction {
$userID = Member :: currentUserID ();
return File :: get () -> filter (array ("OwnerID" => "$userID"));
}
and in the template as follows:
<% Control SomeFunction%>
File Name: $Name | File Size: $Size
<% end_control%>
And there were no questions.
But there is another need - to prevent a user to download a file, if it has already reached the limit on the total size of all files, for example, the limit of N mb. I read the manual, but did not understand what to do. If the table "File", it would be a field "Size", I think I would have found the answer, but it is not there :-) Should I use $Size somewhere inside SomeFunction? Tell me, please, what to do? :-)
Can I do without creating an extra class File (for example, UserFiles extend File)? :-)