File
class File implements ObjectInterface (View source)
Constants
| CREATE_NEW_VERSION_THRESHOLD | 
                     
  | 
            
Properties
| $fID | |||
| $fDateAdded | |||
| $fPassword | |||
| $versions | |||
| $fOverrideSetPermissions | |||
| $ocID | Originally placed on which page.  | 
                ||
| $author | |||
| $folderTreeNodeID | |||
| $storageLocation | 
Methods
No description
For all methods that file does not implement, we pass through to the currently active file version object.
No description
No description
No description
Returns the identifier for the object, in this case the File ID.
Password used to protect the file if set.
Returns the FSL ID for the current file.
No description
No description
Reindex the attributes on this file.
Persist any object changes to the database.
Sets the access password on a file.
No description
No description
No description
No description
Get the user ID of the author of the file (if available).
Get the IDs of the file sets that this file belongs to.
Get the file sets that this file belongs to.
Set the date a file was added
Must call save() to persist.
No description
Create a new version of a file.
Returns a file version object that is to be written to. Computes whether we can use the current most recent version, OR a new one should be created.
File ID of the file.
No description
No description
No description
Removes a file, including all of its versions.
Returns the most recent FileVersion object.
returns the FileVersion object for the provided fvID if none provided returns the approved version.
Returns an array of all FileVersion objects owned by this file.
Total number of downloads for a file.
Get the download statistics for the current file.
Tracks File Download, takes the cID of the page that the file was downloaded from.
Details
        
                            
    __construct()
        
    
    No description
        
                            
    __call($nm, $a)
        
    
    For all methods that file does not implement, we pass through to the currently active file version object.
        
                            
    getPermissionResponseClassName()
        
    
    No description
        
                            
    getPermissionAssignmentClassName()
        
    
    No description
        
                            
    getPermissionObjectKeyCategoryHandle()
        
    
    No description
        
                            
    getPermissionObjectIdentifier()
        
    
    Returns the identifier for the object, in this case the File ID.
        
                            string
    getPassword()
        
    
    Password used to protect the file if set.
        
                            int
    getStorageLocationID()
        
    
    Returns the FSL ID for the current file.
        
                            StorageLocation
    getFileStorageLocationObject()
        
    
    No description
        
                            Version[]
    getFileVersions()
        
    
    No description
        
                            
    reindex()
        
    
    Reindex the attributes on this file.
        
                    protected        
    save()
        
    
    Persist any object changes to the database.
        
                            
    setStorageLocation(StorageLocation $location)
        
    
    Set the storage location for the file.
THIS DOES NOT MOVE THE FILE to move the file use setFileStorageLocation()
Must call save() to persist changes.
        
                            bool
    setFileStorageLocation(StorageLocation $newLocation)
        
    
    Move a file from its current FSL to a new FSL.
        
                            
    setPassword($pw)
        
    
    Sets the access password on a file.
        
                            
    setOriginalPage($ocID)
        
    
    No description
        
                            
    getOriginalPageObject()
        
    
    No description
        
                            bool
    overrideFileFolderPermissions()
        
    
    No description
        
                            
    resetPermissions($fOverrideSetPermissions = 0)
        
    
    No description
        
                            int|null
    getUserID()
        
    
    Get the user ID of the author of the file (if available).
        
                            User|null
    getUser()
        
    
    Get the author of the file (if available).
        
                            
    setUser(User $user)
        
    
    Set the user who authored the file.
        
                            int[]
    getFileSetIDs()
        
    
    Get the IDs of the file sets that this file belongs to.
        
                            FileSet[]
    getFileSets()
        
    
    Get the file sets that this file belongs to.
        
                            bool
    isStarred(bool|User $u = false)
        
    
    Tell if a file is starred by a user.
        
                            
    setDateAdded($fDateAdded)
        
    
    Set the date a file was added
Must call save() to persist.
        
                            
    getDateAdded()
        
    
    No description
        
                            Version
    createNewVersion(bool $copyUnderlyingFile = false)
        
    
    Create a new version of a file.
        
                            Version
    getVersionToModify(bool $forceCreateNew = false)
        
    
    Returns a file version object that is to be written to. Computes whether we can use the current most recent version, OR a new one should be created.
        
                            int
    getFileID()
        
    
    File ID of the file.
        
                            
    setFileFolder(FileFolder $folder)
        
    
    Folder to put the file in.
        
                            NodeType
    getFileFolderObject()
        
    
    No description
        
                            NodeType
    getFileNodeObject()
        
    
    No description
        
                            File
    duplicate()
        
    
    Duplicate a file The new file will have no version history.
        
                            Version|null
    getApprovedVersion()
        
    
    No description
        
                            bool
    inFileSet(Set $fs)
        
    
    If a file is in a particular file set.
        
                            bool
    delete($removeNode = true)
        
    
    Removes a file, including all of its versions.
        
                            Version
    getRecentVersion()
        
    
    Returns the most recent FileVersion object.
        
                            Version
    getVersion(int $fvID = null)
        
    
    returns the FileVersion object for the provided fvID if none provided returns the approved version.
        
                            Version[]
    getVersionList()
        
    
    Returns an array of all FileVersion objects owned by this file.
        
                            int
    getTotalDownloads()
        
    
    Total number of downloads for a file.
        
                            array
    getDownloadStatistics(int $limit = 20)
        
    
    Get the download statistics for the current file.
        
                            
    trackDownload(int $rcID = null)
        
    
    Tracks File Download, takes the cID of the page that the file was downloaded from.
        
                            
    isError()
        deprecated
    
    deprecated
No description