MM表中的TYPO3 crdate字段

时间:2017-08-16 07:08:14

标签: typo3

我有typo3 7.6.18

 #
 # Table structure for table 'tx_feusersplus_user_service_mm'
 #
 CREATE TABLE tx_feusersplus_user_service_mm (
    uid_local int(11) unsigned DEFAULT '0' NOT NULL,
    uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
    sorting int(11) unsigned DEFAULT '0' NOT NULL,
    sorting_foreign int(11) unsigned DEFAULT '0' NOT NULL,

    KEY uid_local (uid_local),
    KEY uid_foreign (uid_foreign)
 );

这是MM关系的表。我想在此表中添加crdate字段并使用它。我可以知道,当添加项目时(时间)。有可能吗?

我可以添加此字段,但我如何使用它?如何在模型和流体中获得它?

1 个答案:

答案 0 :(得分:1)

除了与记录的关系之外,MM表不能具有任何属性。

但是,您可以通过添加TCA并将其用作常规外表而不是MM来将此表提升为常规表。然后该名称可以更改为tx_feusersplus_user_service。这样,您的关系表可以包含所有常规表字段。

如果您在此使用Extbase ObjectStorage,则需要将其项目类型更改为新的UserService模型。该模型有一个属性user和一个属性service,每个属性都包含所需的域模型。

TYPO3中这种富关系表的一个例子是sys_file_reference,它基本上只是记录和文件之间的链接,但是是明确使用的。

相关问题