State

class \TYPO3\CMS\Core\DataHandling\Localization\State

Value object for l10n_state field value.

Table of Contents

Constants

STATE_CUSTOM  : mixed = 'custom'
STATE_PARENT  : mixed = 'parent'
STATE_SOURCE  : mixed = 'source'

Properties

$originalStates  : array
$states  : array
$tableName  : string
$validStates  : array

Methods

__construct()  : mixed
create()  : State|null
export()  : string|null
filterFieldNames()  : string[]
Filters field names having a desired state.
fromJSON()  : State|null
getFieldNames()  : array
getModifiedFieldNames()  : string[]
getState()  : string|null
isApplicable()  : bool
isCustomState()  : bool
isModified()  : bool
isParentState()  : bool
isSourceState()  : bool
isUndefined()  : bool
toArray()  : array
update()  : mixed
updateStates()  : mixed
Updates field names having a particular state to a target state.
enrich()  : array
Add missing states for field names.
hasColumns()  : bool
hasLanguageFieldName()  : bool
hasTranslationParentFieldName()  : bool
sanitize()  : array
Filter out field names that don't exist in TCA.

Constants

STATE_CUSTOM

public mixed STATE_CUSTOM = 'custom'

STATE_PARENT

public mixed STATE_PARENT = 'parent'

STATE_SOURCE

public mixed STATE_SOURCE = 'source'

Properties

$originalStates

protected array $originalStates

$validStates

protected array $validStates = [self::STATE_CUSTOM, self::STATE_SOURCE, self::STATE_PARENT]

Methods

__construct()

public __construct(string $tableName[, array $states = [] ]) : mixed

Parameters

$tableName : string
$states : array = []

create()

public static create(string $tableName) : State|null

Parameters

$tableName : string

Return values

State|null

export()

public export() : string|null

Return values

string|null

filterFieldNames()

Filters field names having a desired state.

public filterFieldNames(string $desiredState[, bool $modified = false ]) : string[]

Parameters

$desiredState : string
$modified : bool = false

Return values

string[]

fromJSON()

public static fromJSON(string $tableName[, string|null $json = null ]) : State|null

Parameters

$tableName : string
$json : string|null = null

Return values

State|null

getFieldNames()

public static getFieldNames(string $tableName) : array

Parameters

$tableName : string

Return values

array

getModifiedFieldNames()

public getModifiedFieldNames() : string[]

Return values

string[]

getState()

public getState(string $fieldName) : string|null

Parameters

$fieldName : string

Return values

string|null

isApplicable()

public static isApplicable(string $tableName) : bool

Parameters

$tableName : string

Return values

bool

isCustomState()

public isCustomState(string $fieldName) : bool

Parameters

$fieldName : string

Return values

bool

isModified()

public isModified() : bool

Return values

bool

isParentState()

public isParentState(string $fieldName) : bool

Parameters

$fieldName : string

Return values

bool

isSourceState()

public isSourceState(string $fieldName) : bool

Parameters

$fieldName : string

Return values

bool

isUndefined()

public isUndefined(string $fieldName) : bool

Parameters

$fieldName : string

Return values

bool

toArray()

public toArray() : array

Return values

array

update()

public update(array $states) : mixed

Parameters

$states : array

updateStates()

Updates field names having a particular state to a target state.

public updateStates(string $currentState, string $targetState) : mixed

Parameters

$currentState : string
$targetState : string

enrich()

Add missing states for field names.

protected enrich(array $states) : array

Parameters

$states : array

Return values

array

hasColumns()

protected static hasColumns(string $tableName) : bool

Parameters

$tableName : string

Return values

bool

hasLanguageFieldName()

protected static hasLanguageFieldName(string $tableName) : bool

Parameters

$tableName : string

Return values

bool

hasTranslationParentFieldName()

protected static hasTranslationParentFieldName(string $tableName) : bool

Parameters

$tableName : string

Return values

bool

sanitize()

Filter out field names that don't exist in TCA.

protected sanitize(array $states) : array

Parameters

$states : array

Return values

array
On this page