\VersionedFileExtension
An extension that adds the ability to replace files with new uploads, and view and roll back to existing versions.
Synopsis
class VersionedFileExtension
extends DataExtension
{
- // methods
- public void updateCMSFields()
- public void onAfterWrite()
- public void onAfterUpload()
- public void onBeforeDelete()
- public int getVersionNumber()
- public void setVersionNumber()
- public void savePreviousVersion()
- public boolean createVersion()
Hierarchy
Extends
- DataExtension
Members
private
- $has_many
- $has_one
Methods
public
- createVersion() — Creates a new file version and sets it as the current version.
- getVersionNumber()
- onAfterUpload() — Since AssetAdmin does not use {@link onBeforeWrite}, onAfterUpload is also needed.
- onAfterWrite() — Creates the initial version when the file is created, as well as updating the version records when the parent file is moved.
- onBeforeDelete() — Deletes all saved version of the file as well as the file itself.
- savePreviousVersion() — Handles rolling back to a selected version on save.
- setVersionNumber()
- updateCMSFields()