[TYPO3-mvc] How to extend a model class from within another extension?

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Fri Jan 15 21:33:15 CET 2010


Good evening folks,

I try to extend a model from within another extension,
and so far I added a TCA definition for a field, added
this in the ext_tables.php and the ext_tables.sql.

The field is shown in the backend and works well so far.

Furthermore I created a new model class, including the
new getter and setter methods for the new field.

The mapping for the new object class looks like this:

config.tx_extbase {
   persistence {
     classes {
       Tx_Ext_Domain_Model_Object {
         mapping {
           columns {
             tx_newext_domain_model_new_field.mapOnProperty = newField
           }
         }
       }

       Tx_NewExt_Domain_Model_Object {
         mapping {
           tableName = tx_ext_domain_model_object

           columns {
             tx_newext_domain_model_new_field.mapOnProperty = newField
           }
         }
       }
     }
   }
}

But somehow the new object is not instantiated/used, still the
old object is returned by the repository - resulting in the
missing getter and setter methods for the new, added field.

Do I need to create a new repository and controller,
and extend the old classes with the new ones as well?

Or am I something missing?

Thanks for your help,
Thomas


More information about the TYPO3-project-typo3v4mvc mailing list