TcaSchemaFactory
class \
This factory returns an object representation of $GLOBALS['TCA']. It is injectable and built during bootstrap.
A TcaSchema contains:
- a list of all fields as defined in [columns]
- a list of "capabilities" (parts defined in the [ctrl] section)
- a list of sub-schemata (if there is a [ctrl][type] definition, then sub-schemata are instances of TcaSchema itself again)
- a list of possible relations of other schemata pointing to this schema ("Passive Relations")
Attributes
- #[Autoconfigure]
- $public: true
- $shared: true
Table of Contents
Properties
- $cache : PhpFrontend
- $cacheIdentifier : string
- $schemaBuilder : TcaSchemaBuilder
- $schemata : SchemaCollection
Methods
- __construct() : mixed
- all() : SchemaCollection<string, TcaSchema>
- Returns all main schemata
- get() : TcaSchema
- Get a schema from the loaded TCA. Ensure to check for a schema with ->has() before calling ->get().
- has() : bool
- Checks if a schema exists, does not build the schema if not needed, thus it's very slim and only creates a schema if a sub-schema is requested.
- load() : void
- Load TCA and populate all schema - throws away existing schema if $force is set.
- rebuild() : void
- Only used for functional tests, which override TCA on the fly for specific test cases.
- warmupCaches() : void
Properties
$cache read-only
protected
PhpFrontend
$cache
Attributes
- #[Autowire]
- $service: 'cache.core'
$cacheIdentifier read-only
protected
string
$cacheIdentifier
Attributes
- #[Autowire]
- $expression: 'service("package-dependent-cache-identifier").withPrefix("TcaSchema").toString()'
$schemaBuilder read-only
protected
TcaSchemaBuilder
$schemaBuilder
$schemata
protected
SchemaCollection
$schemata
Methods
__construct()
public
__construct(TcaSchemaBuilder $schemaBuilder, string $cacheIdentifier, PhpFrontend $cache) : mixed
Parameters
- $schemaBuilder : TcaSchemaBuilder
- $cacheIdentifier : string
- $cache : PhpFrontend
all()
Returns all main schemata
public
all() : SchemaCollection<string, TcaSchema>
Return values
SchemaCollection<string, TcaSchema>get()
Get a schema from the loaded TCA. Ensure to check for a schema with ->has() before calling ->get().
public
get(string $schemaName) : TcaSchema
Parameters
- $schemaName : string
Tags
Return values
TcaSchemahas()
Checks if a schema exists, does not build the schema if not needed, thus it's very slim and only creates a schema if a sub-schema is requested.
public
has(string $schemaName) : bool
Parameters
- $schemaName : string
Return values
boolload()
Load TCA and populate all schema - throws away existing schema if $force is set.
public
load(array $tca[, bool $force = false ]) : void
Parameters
- $tca : array
- $force : bool = false
Internal
only used for TYPO3 Core internally, never use it in public!
rebuild()
Only used for functional tests, which override TCA on the fly for specific test cases.
public
rebuild(array $fullTca) : void
Modifying TCA other than in Configuration/TCA/Overrides must be avoided in production code.
Parameters
- $fullTca : array
Internal
only used for TYPO3 Core internally, never use it in public!
warmupCaches()
public
warmupCaches(CacheWarmupEvent $event) : void
Parameters
- $event : CacheWarmupEvent
Attributes
- #[AsEventListener]
- 'typo3-core/tca-schema'