VersionState

final class \TYPO3\CMS\Core\Versioning\VersionState

Extends
Enumeration

Enumeration object for VersionState

Table of Contents

Constants

__default  : mixed = self::DEFAULT_STATE
DEFAULT_STATE  : mixed = 0
The t3ver_state 0 is used for a live element, and any commonly "modified" versioned record which is then identified with t3ver_oid=uid of live ID
DELETE_PLACEHOLDER  : mixed = 2
Deleting elements is done by actually creating a new version of the element and setting t3ver_state=2 that indicates the live element must be deleted upon publishing the versions.
MOVE_PLACEHOLDER  : mixed = 3
MOVE_POINTER  : mixed = 4
NEW_PLACEHOLDER  : mixed = 1
If a new record is created in a workspace a new record is added with t3ver_state = 1, a so-called "newly versioned record", which acts as a standalone record and has no t3ver_oid value. Publishing this record is done by changing the t3ver_wsid field to "0".
NEW_PLACEHOLDER_VERSION  : mixed = -1
This record was used until TYPO3 v11, but is not in use anymore.

Properties

$enumConstants  : array
$value  : mixed

Methods

__construct()  : mixed
__toString()  : string
Core types must implement the __toString function in order to be serialized to the database;
cast()  : static
Cast value to enumeration type
equals()  : bool
Compare if the value of the current object value equals the given value
getConstants()  : array
Get the valid values for this enum Defaults to constants you define in your subclass override to provide custom functionality
getHumanReadableName()  : string
Returns the name of the constant, first char upper, underscores as spaces
getName()  : string
Returns the constants name as is, without manipulation (usually all upper case)
indicatesPlaceholder()  : bool
isValid()  : bool
Check if the value on this enum is a valid value for the enum
loadValues()  : mixed
setValue()  : mixed
Set the Enumeration value to the associated enumeration value by a loose comparison.

Constants

__default

public mixed __default = self::DEFAULT_STATE

DEFAULT_STATE

The t3ver_state 0 is used for a live element, and any commonly "modified" versioned record which is then identified with t3ver_oid=uid of live ID

public mixed DEFAULT_STATE = 0

DELETE_PLACEHOLDER

Deleting elements is done by actually creating a new version of the element and setting t3ver_state=2 that indicates the live element must be deleted upon publishing the versions.

public mixed DELETE_PLACEHOLDER = 2

MOVE_PLACEHOLDER

Deprecated

this constant is not in use anymore and should be removed from any third-party code

public mixed MOVE_PLACEHOLDER = 3

NEW_PLACEHOLDER

If a new record is created in a workspace a new record is added with t3ver_state = 1, a so-called "newly versioned record", which acts as a standalone record and has no t3ver_oid value. Publishing this record is done by changing the t3ver_wsid field to "0".

public mixed NEW_PLACEHOLDER = 1

NEW_PLACEHOLDER_VERSION

This record was used until TYPO3 v11, but is not in use anymore.

Deprecated

this constant is not in use anymore and should be removed from any third-party code

public mixed NEW_PLACEHOLDER_VERSION = -1

If a new record is created in a workspace a version with t3ver_state -1 is created. This record is the version of the "live" record (t3ver_state=1) where changes are stored, the so-called "versioned record" for new elements.

Properties

$enumConstants

protected static array $enumConstants

Methods

__toString()

Core types must implement the __toString function in order to be serialized to the database;

public __toString() : string

Return values

string

cast()

Cast value to enumeration type

public static cast(mixed $value) : static

Parameters

$value : mixed

Value that has to be casted

Return values

static

equals()

Compare if the value of the current object value equals the given value

public equals(mixed $value) : bool

Parameters

$value : mixed

default

Return values

bool

getConstants()

Get the valid values for this enum Defaults to constants you define in your subclass override to provide custom functionality

public static getConstants([bool $include_default = false ]) : array

Parameters

$include_default : bool = false

Return values

array

getHumanReadableName()

Returns the name of the constant, first char upper, underscores as spaces

public static getHumanReadableName(string|int $value) : string

Parameters

$value : string|int

Return values

string

getName()

Returns the constants name as is, without manipulation (usually all upper case)

public static getName(string|int $value) : string

Parameters

$value : string|int

Return values

string

indicatesPlaceholder()

public indicatesPlaceholder() : bool

Return values

bool

isValid()

Check if the value on this enum is a valid value for the enum

protected isValid(mixed $value) : bool

Parameters

$value : mixed

Return values

bool

setValue()

Set the Enumeration value to the associated enumeration value by a loose comparison.

protected setValue(mixed $value) : mixed

The value, that is used as the enumeration value, will be of the same type like defined in the enumeration

Parameters

$value : mixed

Tags

throws
InvalidEnumerationValueException
On this page