1 | <?php |
||
28 | abstract class VersionInfo extends ValueObject implements MultiLanguageName |
||
29 | { |
||
30 | const STATUS_DRAFT = 0; |
||
31 | const STATUS_PUBLISHED = 1; |
||
32 | const STATUS_ARCHIVED = 3; |
||
33 | |||
34 | /** |
||
35 | * Version ID. |
||
36 | * |
||
37 | * @var mixed |
||
38 | */ |
||
39 | protected $id; |
||
40 | |||
41 | /** |
||
42 | * Version number. |
||
43 | * |
||
44 | * In contrast to {@link $id}, this is the version number, which only |
||
45 | * increments in scope of a single Content object. |
||
46 | * |
||
47 | * @var int |
||
48 | */ |
||
49 | protected $versionNo; |
||
50 | |||
51 | /** |
||
52 | * Content of the content this version belongs to. |
||
53 | * |
||
54 | * @return \eZ\Publish\API\Repository\Values\Content\ContentInfo |
||
55 | */ |
||
56 | abstract public function getContentInfo(); |
||
57 | |||
58 | /** |
||
59 | * the last modified date of this version. |
||
60 | * |
||
61 | * @var \DateTime |
||
62 | */ |
||
63 | protected $modificationDate; |
||
64 | |||
65 | /** |
||
66 | * Creator user ID. |
||
67 | * |
||
68 | * Creator of the version, in the search API this is referred to as the modifier of the published content. |
||
69 | * |
||
70 | * @var mixed |
||
71 | */ |
||
72 | protected $creatorId; |
||
73 | |||
74 | /** |
||
75 | * @var \DateTime |
||
76 | */ |
||
77 | protected $creationDate; |
||
78 | |||
79 | /** |
||
80 | * One of VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED. |
||
81 | * |
||
82 | * @var int Constant. |
||
83 | */ |
||
84 | protected $status; |
||
85 | |||
86 | /** |
||
87 | * In 4.x this is the language code which is used for labeling a translation. |
||
88 | * |
||
89 | * @var string |
||
90 | */ |
||
91 | protected $initialLanguageCode; |
||
92 | |||
93 | /** |
||
94 | * List of languages in this version. |
||
95 | * |
||
96 | * Reflects which languages fields exists in for this version. |
||
97 | * |
||
98 | * @var string[] |
||
99 | */ |
||
100 | protected $languageCodes = array(); |
||
101 | |||
102 | /** |
||
103 | * Returns true if version is a draft. |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | public function isDraft() |
||
111 | |||
112 | /** |
||
113 | * Returns true if version is published. |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function isPublished() |
||
121 | |||
122 | /** |
||
123 | * Returns true if version is archived. |
||
124 | * |
||
125 | * @return bool |
||
126 | */ |
||
127 | public function isArchived() |
||
131 | } |
||
132 |