Dynamic TCA loading
Retrieval of the TCA global array is encapsulated in a class called
\Cobweb\
which implements the
\Cobweb\
interface. This system pursues three aims:
- encapsulating the retrieval of the TCA to simplify following up the evolutions in the TYPO3 Core (like the introduction of the TCA Schema in TYPO3 13).
- abstracting into a base class (
\Cobweb\) all the logic for retrieving all External Import-related configuration from the TCA.External Import\ Domain\ Repository\ Abstract Tca Repository - allowing developers to perfom dynamic manipulations on the TCA by providing their own TCA repository class through dependency injection. This is detailed below.
Custom TCA repository
Although an event exists for manipulating a single import configuration, it is not unusual to have repetitive import configurations, sometimes implying a dynamic modification of the TCA. For such special cases, it may be useful to provide your own custom implementation of a TCA repository.
The recommended way is to extend the abstract class
\Cobweb\
which implements all the methods related to extracting the External Import configurations
from the TCA. The only method to implement is get, where you can
perform any processing you need. Then simply declare your repository as a service
replacing
\Cobweb\,
by placing in your extension's Services. file the following:
services:
_defaults:
autowire: true
autoconfigure: true
public: false
Vendor\ExtName\Import\DynamicTcaRepository:
decorates: Cobweb\ExternalImport\Domain\Repository\TcaRepositoryInterface
public: true