TcaPreparation
Prepare TCA. Used in bootstrap and Flex Form Data Structures, executed *after* TcaMigration.
This is used to add internal TCA details needed by core. For instance, type=category fields receive all the relation details in order to work properly.
Class and API may change any time.
Table of Contents
Methods
- prepare() : array<string|int, mixed>
- Prepare TCA
- configureAllowedDisallowedFileExtensions() : array<string|int, mixed>
- configureFileReferences() helper
- configureAllowedDisallowedInOverrideChildTca() : array<string|int, mixed>
- configureFileReferences() helper
- configureCategoryRelations() : array<string|int, mixed>
- Prepares TCA configuration of type='category' fields.
- configureEmailSoftReferences() : array<string|int, mixed>
- Add "'softref' = 'email[subst]'" to all 'type' = 'email' column fields.
- configureFileReferences() : array<string|int, mixed>
- configureLinkSoftReferences() : array<string|int, mixed>
- Add "'softref' = 'typolink'" to all 'type' = 'link' column fields.
- configureSelectSingle() : array<string|int, mixed>
- Add "'maxitems' => 1" to all "'type' => 'select'" column fields with "'renderType' => 'selectSingle'".
- prepareFileExtensions() : string
- configureFileReferences() helper: Ensures format, replaces placeholders and remove duplicates
Methods
prepare()
Prepare TCA
public
prepare(array<string|int, mixed> $tca[, bool $isFlexForm = false ]) : array<string|int, mixed>
This class is typically called within bootstrap with empty caches after all TCA files from extensions have been loaded. The preparation is then applied and the prepared result is cached. For flex form TCA, this class is called dynamically if opening a record in the backend.
See unit tests for details.
Parameters
- $tca : array<string|int, mixed>
- $isFlexForm : bool = false
Return values
array<string|int, mixed>configureAllowedDisallowedFileExtensions()
configureFileReferences() helper
protected
configureAllowedDisallowedFileExtensions(array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
- $config : array<string|int, mixed>
Return values
array<string|int, mixed>configureAllowedDisallowedInOverrideChildTca()
configureFileReferences() helper
protected
configureAllowedDisallowedInOverrideChildTca(array<string|int, mixed> $overrideChildTcaConfig) : array<string|int, mixed>
Parameters
- $overrideChildTcaConfig : array<string|int, mixed>
Return values
array<string|int, mixed>configureCategoryRelations()
Prepares TCA configuration of type='category' fields.
protected
configureCategoryRelations(array<string|int, mixed> $tca, bool $isFlexForm) : array<string|int, mixed>
It adds some TCA config settings so category fields end up with similar config as type='select' field, but in a more restricted way. Some settings could also be set in TCA directly, but some fields can not be overridden, e.g. foreign_table.
This also sets necessary MM properties, in case relationship is set to "manyToMany", which is the default. Note it is "oneToMany" with flex forms, since flex forms do NOT support "manyToMany".
Finally, all category fields with a "manyToMany" relationship are added to the MM_oppositeUsage of sys_category "items".
Important: Since this method defines a "foreign_table_where", this must always be executed before prepareQuotingOfTableNamesAndColumnNames().
Parameters
- $tca : array<string|int, mixed>
- $isFlexForm : bool
Return values
array<string|int, mixed>configureEmailSoftReferences()
Add "'softref' = 'email[subst]'" to all 'type' = 'email' column fields.
protected
configureEmailSoftReferences(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>configureFileReferences()
protected
configureFileReferences(array<string|int, mixed> $tca, bool $isFlexForm) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
- $isFlexForm : bool
Return values
array<string|int, mixed>configureLinkSoftReferences()
Add "'softref' = 'typolink'" to all 'type' = 'link' column fields.
protected
configureLinkSoftReferences(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>configureSelectSingle()
Add "'maxitems' => 1" to all "'type' => 'select'" column fields with "'renderType' => 'selectSingle'".
protected
configureSelectSingle(array<string|int, mixed> $tca) : array<string|int, mixed>
Parameters
- $tca : array<string|int, mixed>
Return values
array<string|int, mixed>prepareFileExtensions()
configureFileReferences() helper: Ensures format, replaces placeholders and remove duplicates
protected
prepareFileExtensions(mixed $fileExtensions) : string
Parameters
- $fileExtensions : mixed