[TASK] FormEngine JS refactoring: copy JS files
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Versioning / VersionState.php
1 <?php
2 namespace TYPO3\CMS\Core\Versioning;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Enumeration object for VersionState
19 */
20 class VersionState extends \TYPO3\CMS\Core\Type\Enumeration {
21
22 const __default = self::DEFAULT_STATE;
23
24 /**
25 * If a new record is created in a workspace a version
26 * with t3ver_state -1 is created with pid=-1. This
27 * record is the version of the "live" record
28 * (t3ver_state=1) where changes are stored.
29 */
30 const NEW_PLACEHOLDER_VERSION = -1;
31
32 /**
33 * The t3ver_state 0 is used for the live version
34 * of a record and for draft records with pid -1
35 */
36 const DEFAULT_STATE = 0;
37
38 /**
39 * Creating elements is done by first creating a
40 * placeholder element which is in fact live but
41 * carrying a flag (t3ver_state=1) that makes it
42 * invisible online.
43 */
44 const NEW_PLACEHOLDER = 1;
45
46 /**
47 * Deleting elements is done by actually creating a
48 * new version of the element and setting t3ver_state=2
49 * that indicates the live element must be deleted upon
50 * swapping the versions.
51 */
52 const DELETE_PLACEHOLDER = 2;
53
54 /**
55 * Moving elements is done by first creating a placeholder
56 * element which is in fact live but carrying a flag
57 * (t3ver_state=3) that makes it invisible online.
58 * It also has a field, "t3ver_move_id", holding the
59 * uid of the record to move (source record).
60 * In addition, a new version of the source record is made
61 * and has "t3ver_state" = 4 (move-to pointer). This version
62 * is simply necessary in order for the versioning system to
63 * have something to publish for the move operation. So in
64 * summary, two records are created for a move operation in
65 * a workspace: The placeholder (online, with state=3 and
66 * t3ver_move_id set) and a new version (state=4) of the
67 * online source record (the one being moved).
68 */
69 const MOVE_PLACEHOLDER = 3;
70 const MOVE_POINTER = 4;
71
72 /**
73 * @return bool
74 */
75 public function indicatesPlaceholder() {
76 return (int)$this->__toString() > self::DEFAULT_STATE;
77 }
78
79 }