[TYPO3-mvc] create mapping from model to mm table with special fields

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Mon Apr 29 08:52:55 CEST 2013


In your TCA for the message table, there must be some configuration for 
'user' field, that tells the system to use the mm table:
Like:
config => array(
       .....
       'foreign_table' => 'fe_user',
       'MM' => 'message_frontenduser_mm',



On 04/28/2013 04:51 PM, Dawid Pacholczyk wrote:
> Hello I want to create class that is bassed on mm table with some special
> fields. I`m writing plugin that is some kind of message plugin and now I
> want to mark in mm table (message_frontenduser_mm) is message is read by
> user and the creation date for each user.
>
> So I've created Model in my ext and mapping for this table
>
>
>      config.tx_extbase.persistence.classes {
>
> Tx_Messages_Domain_Model_UserMessage {
>
> mapping {
>
>              table = tx_messages_message_frontenduser_mm
>
>              recordType = Tx_Messages_Domain_Model_UserMessage
>
>              columns {
>
>                  uid_local.mapOnProperty = message
>
>                  uid_foreign.mapOnPropery = user
>
>                  is_read.mapOnProperty = isRead
>
>                  creation_date.mapOnProperty = creationDate
>
>              }
>
>          }
>
>      }
>
>      }
>
>
> But in every query T3 is tring to look in
> tx_messages_domain_model_usermessage table not in
> tx_messages_message_frontenduser_mm
>
>
> What am I doing wrong ? How can I map class on this table ?
>
>
> Below sql of my mm table
>
>
>      CREATE TABLE tx_messages_message_frontenduser_mm (
>
>      uid int(11) unsigned DEFAULT '0' NOT NULL,
>
> uid_local int(11) unsigned DEFAULT '0' NOT NULL,
>
> uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
>
> is_read tinyint(1) unsigned DEFAULT '0' NOT NULL,
>
> creation_date int(11) unsigned DEFAULT '0' NOT NULL,
>
> record_type varchar(255) DEFAULT '' 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)
>
>      );
>
>
> Best regards,
> Dawid Pacholczyk
>



More information about the TYPO3-project-typo3v4mvc mailing list