Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TYPO3 v10 Persistence mapping

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?

like image 933
Aristeidis Karavas Avatar asked Mar 10 '20 11:03

Aristeidis Karavas


1 Answers

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

like image 77
Aristeidis Karavas Avatar answered Nov 15 '22 01:11

Aristeidis Karavas