Configure model to use an existing table in extbase

雨燕双飞 提交于 2019-12-12 05:09:52

问题


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
        }
    }
}


来源:https://stackoverflow.com/questions/30460641/configure-model-to-use-an-existing-table-in-extbase

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!