Mikael
Mikael

Reputation: 1309

TYPO3 crdate field in MM table

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)
 );

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 ?

Upvotes: 0

Views: 388

Answers (1)

Mathias Brodala
Mathias Brodala

Reputation: 6460

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

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.

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.

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.

Upvotes: 1

Related Questions