File
class File implements ObjectInterface, ObjectInterface (View source)
Constants
CREATE_NEW_VERSION_THRESHOLD |
|
Properties
$fID | |||
protected string|null | $fUUID | ||
$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.
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.
Get the file UUID.
Assign a new UUID to this file.
Remove the the UUID from this file.
No description
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.
Tracks File Download, takes the cID of the page that the file was downloaded from.
No description
Alias of getAttributeValueObject (assuming $createIfNotExists is false).
No description
Sets the attribute of of the ObjectInterface instance to the specified value, and persists it.
Returns a URL to the file in the file manager
Persist any object changes to the database.
Details
__construct()
No description
__call(mixed $nm, mixed $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.
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.
string|null
getFileUUID()
Get the file UUID.
File
generateFileUUID()
Assign a new UUID to this file.
File
resetFileUUID()
Remove the the UUID from this file.
bool
hasFileUUID()
No description
setFileFolder(FileFolder $folder)
Folder to put the file in.
FileFolder|null
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()
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)
deprecated
deprecated
No description
trackDownload(int $rcID = null)
Tracks File Download, takes the cID of the page that the file was downloaded from.
isError()
deprecated
deprecated
No description
AttributeValueInterface|null
getAttributeValueObject(AttributeKeyInterface|string $ak, bool $createIfNotExists = false)
No description
AttributeValueInterface|null
getAttributeValue(AttributeKeyInterface|string $ak)
Alias of getAttributeValueObject (assuming $createIfNotExists is false).
mixed
getAttribute(AttributeKeyInterface|string $ak, string|false $mode = false)
No description
CategoryInterface
getObjectAttributeCategory()
No description
clearAttribute(AttributeKeyInterface|string $ak)
No description
AttributeValueInterface
setAttribute(AttributeKeyInterface|string $ak, AbstractValue|EmptyRequestAttributeValue|array $value)
Sets the attribute of of the ObjectInterface instance to the specified value, and persists it.
UrlInterface
getDetailsURL()
Returns a URL to the file in the file manager
protected
save()
Persist any object changes to the database.