Sunnysideup\DMS\Model\DMSDocument
Synopsis
class DMSDocument
extends File
implements
DMSDocumentInterface
{
- // members
- private static string $singular_name = 'Document';
- private static string $plural_name = 'Documents';
- private static string $table_name = 'DMSDocument';
- private static array $db = ;
- private static array $has_one = ;
- private static array $owns = ;
- private static array $many_many = ;
- private static array $belongs_many_many = ;
- private static array $searchable_fields = ;
- private static array $summary_fields = ;
- private static array $casting = ;
- private static array $do_not_copy = ;
- private static array $only_copy_if_empty = ;
- // methods
- public static string get_file_type()
- public FieldList getCMSFields()
- public CompositeField getPermissionsActionPanel()
- public void onBeforeWrite()
- public string Icon()
- public void Link()
- public String getLink()
- public string getExtension()
- public void getIdAndTitle()
- protected FieldList getFieldsForFile()
- public $this ingestFile()
- public DataList getRelatedDocuments()
- public ArrayList getRelatedPages()
- protected GridField getRelatedDocumentsGridField()
- protected DataList getRelatedDocumentsForAutocompleter()
- public ValidationResult validate()
- public string getPermissionDeniedReason()
- public $this addActionPanelTask()
- public $this removeActionPanelTask()
- public DMSDocumentInstance replaceDocument()
- public string getTitle()
- public string getDescriptionWithLineBreak()
- public void canCreate()
- public boolean canEdit()
- public boolean canDelete()
- public void CMSEditLink()
- public void CMSAddLink()
Hierarchy
Members
private
- $belongs_many_many
- $casting
- $db
- $do_not_copy
- $has_one
- $many_many
- $only_copy_if_empty
- $owns
- $plural_name
- $searchable_fields
- $singular_name
- $summary_fields
- $table_name
Methods
protected
- getFieldsForFile()
- getRelatedDocumentsForAutocompleter() — Get the list of documents to show in "related documents". This can be modified via the extension point, for example if you wanted to exclude embargoed documents or something similar.
- getRelatedDocumentsGridField() — Get a GridField for managing related documents
public
- CMSAddLink()
- CMSEditLink()
- Icon() — Return the relative URL of an icon for the file type, based on the {@link appCategory()} value.
- Link()
- addActionPanelTask() — Add an "action panel" task
- canCreate()
- canDelete() — see: https://github.com/silverstripe/silverstripe-framework/issues/9129 DataObject delete permissions
- canEdit() — DataObject edit permissions
- getCMSFields()
- getDescriptionWithLineBreak() — Returns the Description field with HTML <br> tags added when there is a line break.
- getExtension() — Return the extension of the file associated with the document
- getIdAndTitle()
- getLink() — Returns a link to download this DMSDocument from the DMS store
- getPermissionDeniedReason() — Returns a reason as to why this document cannot be viewed.
- getPermissionsActionPanel() — Adds permissions selection fields to a composite field and returns so it can be used in the "actions panel"
- getRelatedDocuments() — Get a data list of documents related to this document
- getRelatedPages() — Get a list of related pages for this document by going through the associated document sets
- getTitle() — Return a title to use on the frontend, preferably the "title", otherwise the filename without it's numeric ID
- get_file_type() — Return the type of file for the given extension on the current file name.
- ingestFile() — Takes a file and adds it to the DMSDocument storage, replacing the current file.
- onBeforeWrite()
- removeActionPanelTask() — Removes an "action panel" tasks
- replaceDocument() — Takes a File object or a String (path to a file) and copies it into the DMS, replacing the original document file but keeping the rest of the document unchanged.
- validate() — Checks at least one group is selected if CanViewType || CanEditType == 'OnlyTheseUsers'