‪TYPO3CMS  ‪main
TYPO3\CMS\Core\DataHandling\Localization\State Class Reference

Public Member Functions

 __construct (string $tableName, array $states=[])
 
 update (array $states)
 
 updateStates (string $currentState, string $targetState)
 
 export ()
 
 toArray ()
 
string[] getModifiedFieldNames ()
 
 isModified ()
 
 isUndefined (string $fieldName)
 
 isCustomState (string $fieldName)
 
 isParentState (string $fieldName)
 
 isSourceState (string $fieldName)
 
 getState (string $fieldName)
 
string[] filterFieldNames (string $desiredState, bool $modified=false)
 

Static Public Member Functions

static create (string $tableName)
 
static fromJSON (string $tableName, ?string $json=null)
 
static isApplicable (string $tableName)
 
static string[] getFieldNames (string $tableName)
 

Public Attributes

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

Protected Member Functions

string[] sanitize (array $states)
 
 enrich (array $states)
 

Static Protected Member Functions

static hasColumns (string $tableName)
 
static hasLanguageFieldName (string $tableName)
 
static hasTranslationParentFieldName (string $tableName)
 

Protected Attributes

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

Detailed Description

Value object for l10n_state field value.

Definition at line 25 of file State.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\DataHandling\Localization\State::__construct ( string  $tableName,
array  $states = [] 
)

Member Function Documentation

◆ create()

static TYPO3\CMS\Core\DataHandling\Localization\State::create ( string  $tableName)
static

◆ enrich()

TYPO3\CMS\Core\DataHandling\Localization\State::enrich ( array  $states)
protected

Add missing states for field names.

Definition at line 238 of file State.php.

References TYPO3\CMS\Core\DataHandling\Localization\State\$states.

Referenced by TYPO3\CMS\Core\DataHandling\Localization\State\__construct().

◆ export()

TYPO3\CMS\Core\DataHandling\Localization\State::export ( )

Definition at line 145 of file State.php.

◆ filterFieldNames()

string [] TYPO3\CMS\Core\DataHandling\Localization\State::filterFieldNames ( string  $desiredState,
bool  $modified = false 
)

Filters field names having a desired state.

Returns
‪string[]

Definition at line 206 of file State.php.

References TYPO3\CMS\Core\DataHandling\Localization\State\getModifiedFieldNames().

Referenced by TYPO3\CMS\Core\DataHandling\Localization\State\updateStates().

◆ fromJSON()

static TYPO3\CMS\Core\DataHandling\Localization\State::fromJSON ( string  $tableName,
?string  $json = null 
)
static

◆ getFieldNames()

static string [] TYPO3\CMS\Core\DataHandling\Localization\State::getFieldNames ( string  $tableName)
static

◆ getModifiedFieldNames()

string [] TYPO3\CMS\Core\DataHandling\Localization\State::getModifiedFieldNames ( )

◆ getState()

TYPO3\CMS\Core\DataHandling\Localization\State::getState ( string  $fieldName)

Definition at line 196 of file State.php.

◆ hasColumns()

static TYPO3\CMS\Core\DataHandling\Localization\State::hasColumns ( string  $tableName)
staticprotected

◆ hasLanguageFieldName()

static TYPO3\CMS\Core\DataHandling\Localization\State::hasLanguageFieldName ( string  $tableName)
staticprotected

◆ hasTranslationParentFieldName()

static TYPO3\CMS\Core\DataHandling\Localization\State::hasTranslationParentFieldName ( string  $tableName)
staticprotected

◆ isApplicable()

◆ isCustomState()

TYPO3\CMS\Core\DataHandling\Localization\State::isCustomState ( string  $fieldName)

Definition at line 181 of file State.php.

◆ isModified()

TYPO3\CMS\Core\DataHandling\Localization\State::isModified ( )

◆ isParentState()

TYPO3\CMS\Core\DataHandling\Localization\State::isParentState ( string  $fieldName)

Definition at line 186 of file State.php.

◆ isSourceState()

TYPO3\CMS\Core\DataHandling\Localization\State::isSourceState ( string  $fieldName)

Definition at line 191 of file State.php.

◆ isUndefined()

TYPO3\CMS\Core\DataHandling\Localization\State::isUndefined ( string  $fieldName)

Definition at line 176 of file State.php.

◆ sanitize()

string [] TYPO3\CMS\Core\DataHandling\Localization\State::sanitize ( array  $states)
protected

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

Returns
‪string[]

Definition at line 226 of file State.php.

References TYPO3\CMS\Core\DataHandling\Localization\State\$states.

Referenced by TYPO3\CMS\Core\DataHandling\Localization\State\__construct(), and TYPO3\CMS\Core\DataHandling\Localization\State\update().

◆ toArray()

TYPO3\CMS\Core\DataHandling\Localization\State::toArray ( )

Definition at line 153 of file State.php.

◆ update()

TYPO3\CMS\Core\DataHandling\Localization\State::update ( array  $states)

◆ updateStates()

TYPO3\CMS\Core\DataHandling\Localization\State::updateStates ( string  $currentState,
string  $targetState 
)

Member Data Documentation

◆ $originalStates

array TYPO3\CMS\Core\DataHandling\Localization\State::$originalStates
protected

Definition at line 105 of file State.php.

◆ $states

◆ $tableName

◆ $validStates

array TYPO3\CMS\Core\DataHandling\Localization\State::$validStates
protected
Initial value:

Definition at line 106 of file State.php.

◆ STATE_CUSTOM

const TYPO3\CMS\Core\DataHandling\Localization\State::STATE_CUSTOM = 'custom'

◆ STATE_PARENT

const TYPO3\CMS\Core\DataHandling\Localization\State::STATE_PARENT = 'parent'

◆ STATE_SOURCE

const TYPO3\CMS\Core\DataHandling\Localization\State::STATE_SOURCE = 'source'
‪TYPO3\CMS\Core\DataHandling\Localization\State\STATE_PARENT
‪const STATE_PARENT
Definition: State.php:28
‪TYPO3\CMS\Core\DataHandling\Localization\State\STATE_CUSTOM
‪const STATE_CUSTOM
Definition: State.php:27
‪TYPO3\CMS\Core\DataHandling\Localization\State\STATE_SOURCE
‪const STATE_SOURCE
Definition: State.php:29