[TYPO3-mvc] good practise: get deleted child objects

christian oettinger christian.oettinger at gmx.de
Tue Dec 6 16:58:12 CET 2011


Hi Peter,

thanks a lot for answering!
The tool is up for a while already. When we built it, we did a research 
and read that in extbase childs are just marked as deleted if a field 
"deleted" is present in the Model/DB. Only otherwise they will be really 
deleted.
I really hope this has not changed otherwise we could never update...

Well anyway. In our project we have this rare but real case:
A doctor (FE-User) has made a participation and later deleted himself 
(so deleted flag is set - this works well). Nevertheless he has made the 
participation and we NEED his data to relate it to the participation.

So not seeing another option I for that rare case just use a normal 
SQL-Statement to get the uid in the doctor-field of the parent object. 
And then I fetch the deleted child by it's repostiory. For the Moment. 
If someone can point me to a smarter solution I would be more than happy.

greetings and thanks a lot!
christian (oe)



> Hello oe,
>
> Am 06.12.2011 12:14, schrieb christian oettinger:
>> Hi List,
> [...]
>> When my child object is set to deleted, it is not fetched any more, so
>> $actPart->getDoctor() does not get results. I also do not know how to
>> get just the uid of the child (which is in the field "doctor" of my
>> parent object in DB) to fetch the child manually
>> (setRespectEnableFields(FALSE)).
>>
>> How can I access this value or get the child even if deleted?
>
> Sounds like you are doing it correct. Dont know if support for deleted
> records is implemented all the way.
>
> Add an invalid constraint to your repository method to see the sql
> (sqldebug=TRUE) used.
>
> In general deleted records are deleted, and IMO one should not rely on
> any API to make them visible again.
>
> [...]
>
> Greets and hth,
> Peter



More information about the TYPO3-project-typo3v4mvc mailing list