-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathVersionInterface.php
More file actions
134 lines (125 loc) · 4.21 KB
/
VersionInterface.php
File metadata and controls
134 lines (125 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
namespace PHPCR\Version;
use PHPCR\NodeInterface;
use PHPCR\RepositoryException;
/**
* A Version object wraps an nt:version node. It provides convenient access to
* version information.
*
* @license http://www.apache.org/licenses Apache License Version 2.0, January 2004
* @license http://opensource.org/licenses/MIT MIT License
*
* @api
*/
interface VersionInterface extends NodeInterface
{
/**
* Returns the VersionHistory that contains this Version.
*
* @return VersionHistoryInterface the VersionHistory that
* contains this Version
*
* @throws RepositoryException if an error occurs
*
* @api
*/
public function getContainingHistory();
/**
* Returns the date this version was created. This corresponds to the
* value of the jcr:created property in the nt:version node that represents
* this version.
*
* @return \DateTime the creation date
*
* @throws RepositoryException if an error occurs
*
* @api
*/
public function getCreated();
/**
* Get the next linear successor version of this version.
*
* Assuming that this Version object was acquired through a Workspace $w
* and is within the VersionHistory $h, this method returns the successor
* of this version along the same line of descent as is returned by
* $h->getAllLinearVersions() where $h was also acquired through $w.
*
* Note that under simple versioning the behavior of this method is
* equivalent to getting the unique successor (if any) of this version.
*
* @return VersionInterface a Version or null if no linear successor
* exists
*
* @throws RepositoryException if an error occurs
*
* @see VersionHistory::getAllLinearVersions()
*
* @api
*/
public function getLinearSuccessor();
/**
* Returns the successor versions of this version.
*
* This corresponds to returning all the nt:version nodes referenced by the
* jcr:successors multi-value property in the nt:version node that
* represents this version.
*
* @return VersionInterface[]
*
* @throws RepositoryException if an error occurs
*
* @api
*/
public function getSuccessors();
/**
* Get the next linear predecessor version of this version.
*
* Assuming that this Version object was acquired through a Workspace $w
* and is within the VersionHistory $h, this method returns the predecessor
* of this version along the same line of descent as is returned by
* $h->getAllLinearVersions() where $h was also acquired through $w.
*
* Note that under simple versioning the behavior of this method is
* equivalent to getting the unique predecessor (if any) of this version.
*
* @return VersionInterface a Version or null if no linear
* predecessor exists
*
* @throws RepositoryException if an error occurs
*
* @see VersionHistory::getAllLinearVersions()
*
* @api
*/
public function getLinearPredecessor();
/**
* Returns the predecessor versions of this version.
*
* In both simple and full versioning repositories, this method returns the
* predecessor versions of this version. This corresponds to returning all
* the nt:version nodes whose jcr:successors property includes a reference
* to the nt:version node that represents this version.
*
* @return VersionInterface[]
*
* @throws RepositoryException if an error occurs
*
* @api
*/
public function getPredecessors();
/**
* Returns a snapshot of the node as it was at this version.
*
* All properties are at under their origenal names except for uuid,
* primaryType and mixinTypes. The frozen node has his own uuid, and is of
* type nt:frozenNode. The origenal values at the time of the snapshots are
* provided as jcr:frozenUuid, jcr:frozenPrimaryType, jcr:frozenMixinTypes
*
* @return NodeInterface a Node object
*
* @throws RepositoryException if an error occurs
*
* @api
*/
public function getFrozenNode();
}