State

Value object for l10n_state field value.

Table of Contents

Constants

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

Properties

$originalStates  : array<string|int, mixed>
$states  : array<string|int, mixed>
$tableName  : string
$validStates  : array<string|int, mixed>

Methods

__construct()  : mixed
create()  : State|null
export()  : string|false|null
filterFieldNames()  : array<string|int, string>
Filters field names having a desired state.
fromJSON()  : State|null
getFieldNames()  : array<string|int, string>
getModifiedFieldNames()  : array<string|int, string>
getState()  : string|null
isApplicable()  : bool
isCustomState()  : bool
isModified()  : bool
isParentState()  : bool
isSourceState()  : bool
isUndefined()  : bool
toArray()  : array<string|int, mixed>
update()  : void
updateStates()  : void
Updates field names having a particular state to a target state.
enrich()  : array<string|int, mixed>
Add missing states for field names.
hasColumns()  : bool
hasLanguageFieldName()  : bool
hasTranslationParentFieldName()  : bool
sanitize()  : array<string|int, string>
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<string|int, mixed> $originalStates

$states

protected array<string|int, mixed> $states

$validStates

protected array<string|int, mixed> $validStates = [self::STATE_CUSTOM, self::STATE_SOURCE, self::STATE_PARENT]

Methods

__construct()

public __construct(string $tableName[, array<string|int, mixed> $states = [] ]) : mixed
Parameters
$tableName : string
$states : array<string|int, mixed> = []

create()

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

export()

public export() : string|false|null
Return values
string|false|null

filterFieldNames()

Filters field names having a desired state.

public filterFieldNames(string $desiredState[, bool $modified = false ]) : array<string|int, string>
Parameters
$desiredState : string
$modified : bool = false
Return values
array<string|int, 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<string|int, string>
Parameters
$tableName : string
Return values
array<string|int, string>

getModifiedFieldNames()

public getModifiedFieldNames() : array<string|int, string>
Return values
array<string|int, 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<string|int, mixed>
Return values
array<string|int, mixed>

update()

public update(array<string|int, mixed> $states) : void
Parameters
$states : array<string|int, mixed>

updateStates()

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

public updateStates(string $currentState, string $targetState) : void
Parameters
$currentState : string
$targetState : string

enrich()

Add missing states for field names.

protected enrich(array<string|int, mixed> $states) : array<string|int, mixed>
Parameters
$states : array<string|int, mixed>
Return values
array<string|int, mixed>

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<string|int, mixed> $states) : array<string|int, string>
Parameters
$states : array<string|int, mixed>
Return values
array<string|int, string>

        
On this page

Search results