Simon
Simon

Reputation: 5

TYPO3 Extension Builder Integrate of existing table

I tried to integrate an existing table to my extension. The problem is that the content of the table isn't taken over. I created a new model with the name of the existing table and named the properties according to the existing column names. I also implemented the corresponding getters and setters of the properties.

Extension

The name of the existing table is tx_institutsseminarverwaltung_domain_model_event.

Upvotes: 0

Views: 205

Answers (2)

Felix
Felix

Reputation: 5619

The solution for this issues is:

First get the Typo3 query settings

    $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');

Set RespectStoragePage to false

    $querySettings->setRespectStoragePage(FALSE);

Fetch your repository

    $theRepository = $this->objectManager->get('TYPO3\\institutsseminarverwaltung\\Domain\\Repository\\EventRepository');

And set the query settings to your repository.

    $theRepository->setDefaultQuerySettings($querySettings);

Upvotes: 0

caevv
caevv

Reputation: 170

How are you trying to "consume" or access the data from the other table in your extension?

Do you have a repository for the existing table (maybe there is already an existing repository, that you can reuse)?

See german typo3 board mapping existing tables and SO thread TYPO3 / How to make repository from existing table fe_users?

This question is most likely a duplicate of this question

Upvotes: 1

Related Questions