[TASK] Re-work/simplify copyright header in PHP files - Part 2
[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 * @package TYPO3\CMS\Core\Versioning
21 */
22 class VersionState extends \TYPO3\CMS\Core\Type\Enumeration {
23
24 const __default = self::DEFAULT_STATE;
25
26 /**
27 * If a new record is created in a workspace a version
28 * with t3ver_state -1 is created with pid=-1. This
29 * record is the version of the "live" record
30 * (t3ver_state=1) where changes are stored.
31 */
32 const NEW_PLACEHOLDER_VERSION = -1;
33
34 /**
35 * The t3ver_state 0 is used for the live version
36 * of a record and for draft records with pid -1
37 */
38 const DEFAULT_STATE = 0;
39
40 /**
41 * Creating elements is done by first creating a
42 * placeholder element which is in fact live but
43 * carrying a flag (t3ver_state=1) that makes it
44 * invisible online.
45 */
46 const NEW_PLACEHOLDER = 1;
47
48 /**
49 * Deleting elements is done by actually creating a
50 * new version of the element and setting t3ver_state=2
51 * that indicates the live element must be deleted upon
52 * swapping the versions.
53 */
54 const DELETE_PLACEHOLDER = 2;
55
56 /**
57 * Moving elements is done by first creating a placeholder
58 * element which is in fact live but carrying a flag
59 * (t3ver_state=3) that makes it invisible online.
60 * It also has a field, "t3ver_move_id", holding the
61 * uid of the record to move (source record).
62 * In addition, a new version of the source record is made
63 * and has "t3ver_state" = 4 (move-to pointer). This version
64 * is simply necessary in order for the versioning system to
65 * have something to publish for the move operation. So in
66 * summary, two records are created for a move operation in
67 * a workspace: The placeholder (online, with state=3 and
68 * t3ver_move_id set) and a new version (state=4) of the
69 * online source record (the one being moved).
70 */
71 const MOVE_PLACEHOLDER = 3;
72 const MOVE_POINTER = 4;
73
74 /**
75 * @return boolean
76 */
77 public function indicatesPlaceholder() {
78 return (int)$this->__toString() > self::DEFAULT_STATE;
79 }
80 }