File
class File (View source)
Service class for the File entity
Methods
Returns a file object in several conditions. If a UUID is given, we only check using that method.
Return the relative path for a file (may not exist).
Create and persist a File entity and a File\Version entity (the filesystem file must already have been imported).
Details
        
                static            File|null
    getByID(int $fID)
        
    
    Return a file object for the given file ID.
        
                static            File|null
    getByUUID(int $fUUID)
        
    
    Return a file object for the given file UUID.
        
                static            File|null
    getByUUIDOrID($id)
        
    
    Returns a file object in several conditions. If a UUID is given, we only check using that method.
Otherwise, if an integer is given, we retrieve the object first. Then, we check to see if a UUID is present on the file. If a UUID is not present, we return the object. If it is present, we do not, because this file is no longer accessible via the numerical ID when using this method.
        
                static            string|false
    getRelativePathFromID(int $fID)
        
    
    Return the relative path for a file (may not exist).
        
                static            Version
    add(string $filename, string $prefix, array $data = [], StorageLocation|false $fsl = false, FileFolder|false $folder = false)
        
    
    Create and persist a File entity and a File\Version entity (the filesystem file must already have been imported).