TYPO3 v10 Persistence mapping
Asked Answered
C

1

5

TYPO3 v10 has changed the way that maps the persistence classes. The old way looks like this:

config.tx_extension_extension {
   persistence {
     classes {
        Vendor\ExtensionExtend\Domain\Model\Object{
           mapping {
             tableName = tx_extension_domain_model_object
           }
        }
        Vendor\ExtensionExtend\Domain\Model\Object1{
           mapping {
             tableName = tx_extension_domain_model_object1
           }
        }
     }
   }
} 

How is this possible on TYPO3 v10?

Catto answered 10/3, 2020 at 11:42 Comment(0)
C
13

In order to achieve that, you should do the following:

1. Step

Create the Classes.php file under your extension_extend/Configuration/Extbase/Persistence/

2. Step

Return something like that:

<?php
declare(strict_types = 1);

return [
    \Vendor\ExtensionExtend\Domain\Model\Object::class => [
        'tableName' => 'tx_extension_domain_model_object',
    ],
    \Vendor\ExtensionExtend\Domain\Model\Object1::class => [
        'tableName' => 'tx_extension_domain_model_object1',
    ],
];

And you 're ready to go.

Documentation

Breaking: #87623 - Replace config.persistence.classes typoscript configuration

Best regards

Catto answered 10/3, 2020 at 11:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.