[TYPO3-mvc] Abstract Classes and the DB

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu May 12 17:43:33 CEST 2011


Hey,

> I was searching to get an answer, but there seems no answer out there for my problem...
> I hope you can help me. I have two questions:
>
> 1) Is it possible to create repositories of abstract classes in extbase?
> 2) Is it possible to save and retrieve (!) an abstract class with single table inheritance?

IIRC yes, as long as the class file of your model is regular named 
("Model.php" and not "AbstractModel.php") and of course only as long as 
EVERY object fetched from the repository belongs to a STI type because 
you can't instantiate a abstract class as soon as the STI type is 
missing. But you could run into trouble with the propertyMapper if your 
"BaseModel" is a abstract class and STI can't apply to the incoming 
object data.

But as I said, I'm not entirely sure. I of course use STI but I didn't 
declare my BaseModels as abstract for some reason I can't remember now.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list