[TYPO3-mvc] How to keep Domain Entity non-persistent
Thomas Allmer
at at delusionworld.com
Tue Oct 11 03:22:09 CEST 2011
yeah that definitely looks like some repository stuff... but I guess
that should not be there without a repository...
I just checked my code and my demand object looks like yours and my form
is just this.. (well a little more complex... :p)
<f:form action="index" objectName="demand" object="{demand}">
<div>
<f:form.textbox id="searchWord" property="searchWord" />
<button type="submit">Suche</button>
</div>
</f:form>
and I don't have "any" problems with my demand object... [1].
so that should work....
you don't have the demand object as a property in any other class right?
[1]: (except manually doing some mapping and converting it to an array
for link generation and overwriting via overwrite demand...) all not
really problems :p
On 11.10.2011 02:40, g4-lisz at tonarchiv.ch wrote:
> 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
>>
>>
>
--
+---------------------------------+-----------------------------------+
| Thomas Allmer | http://www.delusionworld.com |
| E-mail: at at delusionworld.com | phone: +43 699 16217064 |
+---------------------------------+-----------------------------------+
More information about the TYPO3-project-typo3v4mvc
mailing list