This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Model_File

Concrete5_Library_Object
Extended by Object
Extended by Concrete5_Model_File

Direct known subclasses

File

Package: Utilities
Located at core/models/file.php

Methods summary

public static File
# getByID( integer $fID )

returns a file object for the given file ID

public
# __call( $nm, $a )

For all methods that file does not implement, we pass through to the currently active file version object

public
public
# getPath( )
public
public
public
public
# reindex( )
public static
public
public
# setPassword( $pw )
public
# setOriginalPage( $ocID )
public
public
public
# resetPermissions( $fOverrideSetPermissions = 0 )
public
public
# setUserID( $uID )
public
public
# isStarred( $u = false )
public
public
# getVersionToModify( $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

public
public
public static
# add( $filename, $prefix, $data = array() )
public
# addVersion( $filename, $prefix, $data = array() )
public
public
# inFileSet( $fs )
public
# delete( )

Removes a file, including all of its versions

public FileVersion
# getRecentVersion( )

returns the most recent FileVersion object

public FileVersion
# getVersion( integer $fvID = null )

returns the FileVersion object for the provided fvID if none provided returns the approved version

public
# getVersionList( )

Returns an array of all FileVersion objects owned by this file

public
public
# getDownloadStatistics( $limit = 20 )
public
# trackDownload( integer $rcID = NULL )

Tracks File Download, takes the cID of the page that the file was downloaded from

Constants summary

integer CREATE_NEW_VERSION_THRESHOLD
# 300
integer F_ERROR_INVALID_FILE
# 1
integer F_ERROR_FILE_NOT_FOUND
# 2

Properties summary

Properties inherited from Concrete5_Library_Object

$error