TcaSchemaFactory

class \TYPO3\CMS\Core\Schema\TcaSchemaFactory

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

$cacheIdentifier read-only

protected string $cacheIdentifier

Attributes

#[Autowire]
$expression: 'service("package-dependent-cache-identifier").withPrefix("TcaSchema").toString()'

Methods

has()

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

bool

load()

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

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
On this page