[TYPO3-mvc] How to keep Domain Entity non-persistent
g4-lisz at tonarchiv.ch
g4-lisz at tonarchiv.ch
Tue Oct 11 02:40:45 CEST 2011
hi thomas,
there is no repository for it.
Yes it is created with a f:form.
I put the line
protected $uid=1;
in the Demad Class file...
Then it worked once, but after a second search form submission i got the
error:
"Table 'mydb.tx_myext_domain_model_searchdemand' doesn't exist: SELECT
tx_myext_domain_model_searchdemand.* FROM
tx_myext_domain_model_searchdemand WHERE
tx_myext_domain_model_searchdemand.uid = '1' LIMIT 1"
That really looks like repository stuff...
Cheers,
Till
On 11.10.2011 02:23, Thomas Allmer wrote:
> hey,
>
> extbase persists stuff only if there is a repository for it...
> so do you have a file called
> Classes/Domain/Repository/DemandRepository.php
> if so just delete it...
>
> but I guess your problem has nothing to do with persistence..
> how do you create your demand object? with a f:form?
>
> cheers
>
> On 11.10.2011 01:51, g4-lisz at tonarchiv.ch wrote:
>> 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