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

Dawid Pacholczyk dpacholczyk at gmail.com
Sun Apr 28 16:51:18 CEST 2013


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

-- 
Dawid Pacholczyk
tel: 502-054-334
gg: 5564051
skype: dpacholczyk
http://typo3blog.pl (only polish version at the moment)


More information about the TYPO3-project-typo3v4mvc mailing list