‪TYPO3CMS  ‪main
VersionState.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
21 enum ‪VersionState: int
22 {
28  case DEFAULT_STATE = 0;
29 
37  case NEW_PLACEHOLDER = 1;
38 
45  case DELETE_PLACEHOLDER = 2;
46 
57  case MOVE_POINTER = 4;
58 
59  public function ‪indicatesPlaceholder(): bool
60  {
61  return $this !== self::NEW_PLACEHOLDER && $this !== self::DEFAULT_STATE;
62  }
63 
69  public static function cast(mixed $value): ?self
70  {
71  trigger_error(
72  __METHOD__ . ' has been marked as deprecated in TYPO3 v13. Use VersionState::tryFrom() instead.',
73  E_USER_DEPRECATED,
74  );
75  return $value instanceof self ? $value : self::tryFrom((int)$value);
76  }
77 
83  public function equals(mixed $value): bool
84  {
85  trigger_error(
86  __METHOD__ . ' has been marked as deprecated in TYPO3 v13. Use VersionState::tryFrom() and native comparison logic instead.',
87  E_USER_DEPRECATED,
88  );
89  return $this === ($value instanceof self ? $value : self::tryFrom((int)$value));
90  }
91 }
‪TYPO3\CMS\Core\Versioning\indicatesPlaceholder
‪@ indicatesPlaceholder
Definition: VersionState.php:59
‪TYPO3\CMS\Core\Versioning\VersionState
‪VersionState
Definition: VersionState.php:22
‪TYPO3\CMS\Core\Versioning
Definition: VersionState.php:16