配置模型以使用extbase中的现有表 [英] Configure model to use an existing table in extbase
问题描述
我使用extbase在Typo3 4.5中构建了一个扩展.自动是名称为"tx_piproductdetail_domain_model_product"创建的产品模型的新表,但我希望将其设置为使用现有表"tx_piproducts_domain_model_product".我尝试修改TCA文件..但无法进行.这是为该型号配置TCA文件的方式
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
推荐答案
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.
可以使用TypoScript设置将现有表映射到模型,这是示例,您的设置应如下所示:
Mapping of existing tables to your model can be done with a TypoScript setup, here's an example how your setup should look like:
配置/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
}
}
}
这篇关于配置模型以使用extbase中的现有表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!