[TYPO3-mvc] ValueObjects vs. Entities

Susanne Moog typo3 at susanne-moog.de
Fri Dec 4 08:34:49 CET 2009


hi,

has nobody an idea on this? should I just use abstractEntity to avoid
such errors?

Best regards,

Susanne


Susanne Moog wrote:
> 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