[TYPO3-mvc] ValueObjects vs. Entities

Jochen Rau jochen.rau at typoplanet.de
Fri Dec 4 08:59:36 CET 2009


Hi Susanne.

schrieb Susanne Moog:
> If I now try to display entries, I get a fatal error:
>
> #1: PHP Catchable Fatal Error: Argument 1 passed to
> Tx_Extbase_Persistence_Mapper_DataMapper::fetchRelated() must be an
> instance of Tx_Extbase_DomainObject_AbstractEntity instance of
> Tx_Apprenticeships_Domain_Model_Informationevents given, called in
> /var/www/typo3dev/trunk/typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php
> on line 201 and defined in
> /var/www/typo3dev/trunk/typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php
> line 222
>
> If I switch the model mentioned in the error message
> (Tx_Apprenticeships_Domain_Model_Informationevents) in an abstractEntity
> instead of a value object, everything works as expected.
>
> I have it now working with 3 value objects and 2 entities. What I wanted
> to know is if there is some way to distinguish what I can do (or should
> do) with which model type?

Could you please post your actual (desired) class hierarchy, please?

Regards
Jochen

-- 
Every nit picked is a bug fixed



More information about the TYPO3-project-typo3v4mvc mailing list