\DMSDocument_versions
DataObject to store versions of uploaded Documents.
Versions are only created when replacing a document, not on every save of the
DMSDocument dataobject. So, versions store the various versions of the
underlying Document, not the DataObject with information about that object.
Synopsis
class DMSDocument_versions
extends DataObject
{
- // members
- public static bool $enable_versions = true;
- private static array $db = ;
- private static array $has_one = ;
- private static array $defaults = ;
- private static array $display_fields = ;
- private static array $summary_fields = ;
- private static array $field_labels = ;
- private static array $default_sort = ;
- // methods
- public static bool create_version()
- public void delete()
- public static DataList get_versions()
- public void __construct()
- public string getLink()
- public bool isHidden()
- public string getFullPath()
- public string getFilenameWithoutID()
- protected string generateVersionedFilename()
- public string getExtension()
- public string getSize()
- public string getAbsoluteSize()
- public string getFileSizeFormatted()
- public DMSDocument_versions trackView()
Hierarchy
Extends
- DataObject
Members
private
- $db
- $default_sort
- $defaults
- $display_fields
- $field_labels
- $has_one
- $summary_fields
public
- $enable_versions — bool
Methods
protected
- generateVersionedFilename() — Creates a new filename for the current Document's file when replacing the current file with a new file.
public
- __construct()
- create_version() — Creates a new version of a document by moving the current file and renaming it to the versioned filename.
- delete()
- getAbsoluteSize() — Return the size of the file associated with the document.
- getExtension() — Return the extension of the file associated with the document.
- getFileSizeFormatted() — An alias to DMSDocument::getSize()
- getFilenameWithoutID()
- getFullPath() — Returns the full filename of the document stored in this object. Can optionally specify which filename to use at the end.
- getLink() — Returns a link to download this document from the DMS store.
- getSize()
- get_versions() — Returns a DataList of all previous Versions of a document (check the LastEdited date of each object to find the correct one).
- isHidden() — Document versions are always hidden from outside viewing. Only admins can download them.
- trackView()