Configure model to use an existing table in extbas

2019-09-10 03:48发布

问题:

I built an extension in Typo3 4.5 using extbase. automatically was new table for a product model created with the name "tx_piproductdetail_domain_model_product",but my hope is to set it to use the already existing table "tx_piproducts_domain_model_product" instead. I tried to modify the TCA file .. but couldn't make it . Here is how the TCA file is configured for that model

http://laravel.io/bin/W44z5.

回答1:

http://docs.typo3.org/typo3cms/ExtbaseFluidBook/b-ExtbaseReference/Index.html#typoscript-configuration

persistence.classes

This settings are used with individual classes. That includes in particular the mapping of classes and property names to tables and field names.

Mapping of existing tables to your model can be done with a TypoScript setup, here's an example how your setup should look like:

Configuration/TypoScript/setup.txt

config.tx_extbase.persistence.classes.Tx_PiProductDetail_Domain_Model_Product {
    mapping {
        tableName = tx_piproducts_domain_model_product
        columns {
            some_column_name.mapOnProperty = someColumnName
        }
    }
}


标签: model extbase