[TYPO3-mvc] ValueObjects vs. Entities

Susanne Moog typo3 at susannemoog.de
Wed Dec 2 07:52:42 CET 2009


Hello everyone,

I guess I have a problem with understanding the concept of valueObjects
vs. entities. I have read some stuff and set up my model accordingly.
The domain consists of 5 related models (tables).

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?

Thanks for any hints,

Susanne


More information about the TYPO3-project-typo3v4mvc mailing list