我使用域模型创建了一个扩展Message
。该模型与 TYPO3 具有 m:n 关系pages
(包含页面详细信息的表,如标题、issite_root 等)表。然而,通过使用mapping to existing tables
选项,它给了我type
错误提示页面:
The configured type field for table "pages" is of type int(11) unsigned
This means the type field can not be used for defining the record type.
You have to configure the mappings yourself if you want to map to this
table or extend the correlated class
所以我只是创建关系而不进行映射,以便稍后可以从setup.txt
.
![enter image description here](https://i.stack.imgur.com/evYkz.png)
我创建的模型Pages
in MyExt/Classes/Domain/Model/
所有 getter/setter 和存储库都在MyExt/Classes/Domain/Repository/
.
在我的 setup.txt 中我这样做了:
config.tx_extbase {
persistence{
enableAutomaticCacheClearing = 1
updateReferenceIndex = 0
classes {
Tx_Playfield_Domain_Model_Pages {
mapping {
tableName = pages
columns {
uid.mapOnProperty = uid
pid.mapOnProperty = pid
sorting.mapOnProperty = sorting
title.mapOnProperty = title
subtitle.mapOnProperty = subtitle
}
}
}
}
}
}
但是当我尝试访问我创建的 Pages 模型时,
var_dump($this->pagesRepository->findByUid(74));
它正在寻找tx_playfield_domain_model_pages
它不存在,它表明
Table 'typo3.tx_playfield_domain_model_pages' doesn't exist: SELECT tx_playfield_domain_model_pages.* FROM tx_playfield_domain_model_pages WHERE tx_playfield_domain_model_pages.uid = '74' LIMIT 1
我在这里缺少什么?
Update
关注后http://t3-developer.com/extbase-fluid/cheats-extbase/model/tabelle-pages-in-extbase/由@Michael建议我得到一个empty result
from $this->pagesRepository->findByUid(74)
setup.txt
正在加载。我这样做是为了检查它:
plugin.tx_playfield{
settings{
temp=yes
}
}
这是从我的控制器访问的。