Completed
Push — master ( f9f56b...97d556 )
by Robbie
02:07
created

code/interface/DMSDocumentInterface.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Interface for a DMSDocument used in the Document Management System. A DMSDocument is create by storing a File
4
 * object in an instance of the DMSInterface. All write operations on the DMSDocument create a new relation, so we
5
 * never need to explicitly call the write() method on the DMSDocument DataObject
6
 */
7
interface DMSDocumentInterface
8
{
9
    /**
10
     * Returns a link to download this DMSDocument from the DMS store
11
     * @return String
12
     */
13
    public function getLink();
14
15
    /**
16
     * Return the extension of the file associated with the document
17
     */
18
    public function getExtension();
0 ignored issues
show
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
19
20
    /**
21
     * Returns the size of the file type in an appropriate format.
22
     *
23
     * @return string
24
     */
25
    public function getSize();
26
27
    /**
28
     * Return the size of the file associated with the document, in bytes.
29
     *
30
     * @return int
31
     */
32
    public function getAbsoluteSize();
33
34
35
    /**
36
     * Takes a File object or a String (path to a file) and copies it into the DMS, replacing the original document file
37
     * but keeping the rest of the document unchanged.
38
     * @param $file File object, or String that is path to a file to store
39
     * @return DMSDocumentInstance Document object that we replaced the file in
40
     */
41
    public function replaceDocument($file);
42
43
    /**
44
     * Hides the DMSDocument, so it does not show up when getByPage($myPage) is called
45
     * (without specifying the $showEmbargoed = true parameter). This is similar to expire, except that this method
46
     * should be used to hide DMSDocuments that have not yet gone live.
47
     * @return null
48
     */
49
    public function embargoIndefinitely();
50
51
    /**
52
     * Returns if this is DMSDocument is embargoed or expired.
53
     * @return bool True or False depending on whether this DMSDocument is embargoed or expired
54
     */
55
    public function isHidden();
56
57
58
    /**
59
     * Returns if this is DMSDocument is embargoed.
60
     * @return bool True or False depending on whether this DMSDocument is embargoed
61
     */
62
    public function isEmbargoed();
63
64
    /**
65
     * Hides the DMSDocument, so it does not show up when getByPage($myPage) is called. Automatically un-hides the
66
     * DMSDocument at a specific date.
67
     * @param $datetime String date time value when this DMSDocument should expire
68
     * @return null
69
     */
70
    public function embargoUntilDate($datetime);
71
72
    /**
73
     * Hides the document until any page it is linked to is published
74
     * @return null
75
     */
76
    public function embargoUntilPublished();
77
78
    /**
79
     * Clears any previously set embargos, so the DMSDocument always shows up in all queries.
80
     * @return null
81
     */
82
    public function clearEmbargo();
83
84
    /**
85
     * Returns if this is DMSDocument is expired.
86
     * @return bool True or False depending on whether this DMSDocument is expired
87
     */
88
    public function isExpired();
89
90
    /**
91
     * Hides the DMSDocument at a specific date, so it does not show up when getByPage($myPage) is called.
92
     * @param $datetime String date time value when this DMSDocument should expire
93
     * @return null
94
     */
95
    public function expireAtDate($datetime);
96
97
    /**
98
     * Clears any previously set expiry.
99
     * @return null
100
     */
101
    public function clearExpiry();
102
103
    /*---- FROM HERE ON: optional API features ----*/
104
105
    /**
106
     * Returns a DataList of all previous Versions of this DMSDocument (check the LastEdited date of each
107
     * object to find the correct one)
108
     * @return DataList List of DMSDocument objects
109
     */
110
    public function getVersions();
111
}
112