MM 表中的 TYPO3 crdate 字段 [英] TYPO3 crdate field in MM table

查看:25
本文介绍了MM 表中的 TYPO3 crdate 字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有错别字 3 7.6.18

I have 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 字段添加到该表并使用它.我可以知道的字段,添加项目的时间(时间).可能吗?

This is table for MM relation. I want to add crdate field to this table and use it. Field for I can know, when item was added (time). Is it possible ?

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

I can add this field, but how I can use it ? How to get it in model and in fluid ?

推荐答案

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

MM tables cannot have any attributes besides the relations to records.

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

You can however, promote this table to a regular one by adding TCA and using it as regular foreign table instead of MM. The name could then change to tx_feusersplus_user_service. This way your relation table can have all regular table fields.

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

If you are using an Extbase ObjectStorage here you'll need to change its item type to your new UserService model. That model has one property user and one property service, each with the desired domain model.

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

One example of such a rich relation table in TYPO3 is sys_file_reference which is basically only a link between records and files but is used explicitly.

这篇关于MM 表中的 TYPO3 crdate 字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆