ドメイン モデルで拡張機能を作成しましたMessage
。pages
このモデルは、TYPO3 (タイトル、issite_root などのページの詳細を持つもの) テーブルとの関係 m:n を持っています。ただし、mapping to existing tables
オプションを使用すると、 type
page というエラーが表示されます:
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
です。
のすべてのゲッター/セッターとリポジトリを使用してモデルを作成Pages
しました。MyExt/Classes/Domain/Model/
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
ここで何が欠けていますか?
アップデート
@Michael によって提案されたhttp://t3-developer.com/extbase-fluid/cheats-extbase/model/tabelle-pages-in-extbase/をフォローした後empty result
、$this->pagesRepository->findByUid(74)
setup.txt
読み込んでいます。私はそれを確認するためにこれをしました:
plugin.tx_playfield{
settings{
temp=yes
}
}
そして、これは私のコントローラーからアクセスされています。