---
title: "Dynamic TCA loading"
manual: "External Import"
version: "main"
permalink: "https://docs.typo3.org/permalink/cobweb/external_import:developer-tca@main"
source: "Developer/Tca/Index.rst"
rendered: "2026-10-17T19:10:20+00:00"
---

# Dynamic TCA loading {#developer-tca}

Retrieval of the TCA global array is encapsulated in a class called
`\Cobweb\ExternalImport\Domain\Repository\TcaDirectAccessRepository`
which implements the `\Cobweb\ExternalImport\Domain\Repository\TcaRepositoryInterface`
interface. This system pursues three aims:

1.  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).
1.  abstracting into a base class (`\Cobweb\ExternalImport\Domain\Repository\AbstractTcaRepository`)
    all the logic for retrieving all External Import-related configuration from the TCA.
1.  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 {#developer-tca-custom-repository}

Although an [event exists for manipulating a single import configuration](https://docs.typo3.org/permalink/cobweb/external_import:developer-events-dhange-configuration-before-run@main),
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\ExternalImport\Domain\Repository\AbstractTcaRepository`
which implements all the methods related to extracting the External Import configurations
from the TCA. The only method to implement is `getTca()`, where you can
perform any processing you need. Then simply declare your repository as a service
replacing `\Cobweb\ExternalImport\Domain\Repository\TcaDirectAccessRepository`,
by placing in your extension's `Services.yaml` file the following:

```yaml
services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  Vendor\ExtName\Import\DynamicTcaRepository:
    decorates: Cobweb\ExternalImport\Domain\Repository\TcaRepositoryInterface
    public: true
```
