[TYPO3-mvc] Confusion about recordTypeColumnName of a model

Peter Niederlag typo3-list at niekom.de
Wed Feb 2 09:20:38 CET 2011


Hello,

Am 01.02.2011 16:43, schrieb Sebastian Michaelsen:
[...]
> This is because the TCA definition says be_users can be of different
> types according to the field 'admin' which is a boolean field. But
> extbase seems to think that the record type in terms of what kind of
> object it is, is stored in that 'admin' field.

type being a boolean field is a rather rare case IMO.

[...]

> Maybe I got all that wrong, so I'd be thankful for any explanations.

I think you got it (almost) right. There is also the possibilty to 
adjust the proper (sub-)classes based on the type value via TypoScript.
This might(!) be able to help you:

config.tx_extbase {
   persistence{
     classes {
       Tx_Whatever_D_M-Beuser {
         # define the subclasses
         subclasses {
           Tx_Whatever_D_M-Xya = Tx_Whatever_D_M-Xya
           Tx_Whatever_D_M-Xyb = Tx_Whatever_D_M-Xyb
	}
         mapping {
           tableName = be_users
         }
       }
       Tx_Whatever_D_M-Xya {
         mapping {
           recordType = 0
           tableName = be_users
         }
       }
       Tx_Whatever_D_M-Xyb {
         mapping {
           recordType = 1
           tableName = be_users
         }
       }
     }
   }
}

But you could also file a bug/feature-request on forge to solve/improve 
the handling of the type-field.

Greets,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *


More information about the TYPO3-project-typo3v4mvc mailing list