\FileVersion
This class represents a single version of a file. Each file can have many versions, and one of these is currently active at any one time.
Synopsis
class FileVersion
extends DataObject
{
- // constants
- const VERSION_FOLDER = '_versions';
- // methods
- public void onBeforeWrite()
- public void onBeforeDelete()
- public string getTitle()
- public string getName()
- public string getURL()
- public string getFullPath()
- public Boolean IsCurrent()
- protected string saveCurrentVersion()
Hierarchy
Extends
- DataObject
Constants
Name | Value |
---|---|
VERSION_FOLDER | '_versions' |
Members
private
- $db
- $has_one
Methods
protected
- saveCurrentVersion() — Saves the current version of the linked File object in a versions directory, then returns the relative path to where it is stored.
public
- IsCurrent() — Returns a Boolean object indicating if this version is currently active.
- getFullPath()
- getName()
- getTitle()
- getURL()
- onBeforeDelete()
- onBeforeWrite() — Saves version meta-data, and generates the saved file version on first write.