[TYPO3-mvc] How to keep Domain Entity non-persistent

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Tue Oct 11 01:51:40 CEST 2011


Hi there,

my problem is related to another message i wrote about two weeks ago 
("Very strange "serialize Domain Object" error").

I'm trying to realize a search filter using a 
Tx_Extbase_DomainObject_AbstractEntity "demand":

class Tx_Myext_Domain_Model_Demand extends 
Tx_Extbase_DomainObject_AbstractEntity {
/**
* @var Tx_Myext_Domain_Model_Prop1 The demanded organization
**/
protected $prop1;

/**
* @var Tx_Myext_Domain_Model_Prop2 The demanded organization
**/
protected $prop2;

     [etc.]
}

A Demand Object is passed to my search form:

public function indexAction(Tx_Mext_Domain_Model_Demand $demand = NULL) {
$this->view->assign('demand', $demand);
$this->view->assign('results',$this->someRepository->findDemanded( 
$demand));
     etc.
}

The same technique is used in some samples on the internet.

It worked for a while until i added some more properties. Since then i 
get the
"Could not serialize Domain Object Tx_Myext_Domain_Model_Demand. It is 
neither an Entity with identity properties set, nor a Value Object."
Error.

I think that this happens because extbase tries to persist the object 
after it has reached a certain size.
The error is rised from 
Tx_Extbase_MVC_Web_Routing_UriBuilder::convertDomainObjectsToIdentityArrays() 
because the Demand object doesn't have a valid uid.

How can i solve this issue?
Is there a way to keep the Demand object volatile?

Any help will be much appreciated!
Cheers, Till


More information about the TYPO3-project-typo3v4mvc mailing list