[TYPO3-mvc] unset relation

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Feb 10 16:20:43 CET 2011


Hey Peter,

> Am 10.02.2011 13:46, schrieb Peter Niederlag:
>> Hello,
> [...]
>> Is there any "out-of-the-box" solution that enables me to unset the
>> relation when submitting tx_foo_dm_a?
>
> /**
> * initializeUpdatedateAction
> *
> */
> public function initializeUpdateDateAction() {
> if($this->request->hasArgument('date')) {
> $date = $this->request->getArgument('date');
> if($date['group'] == '0') {
> $this->removeGroupFromDate = TRUE;
> }
> }
> }
>
> pubclic function updateDateAction() {
> if ($this->removeGroupFromDate) {
> $date->unsetGroup();
> }
> }
>
>
> // in The Model
> public function unsetGroup() {
> this->group = NULL;
> }
>
> works for me, and doesn't require any patch on Property/Mapper. ;)

nice workaround, but there should of course still be builtin way to 
achieve this. IIRC there where some changes in that area after 1.2.0, 
but I'm not entirely sure.

What would be the suggested way/behavior in your eyes. Which value 
should trigger the deletion? I think '' and 0 shouldn't alter the 
relation, but maybe a -1 could indicate a deletion? Does anybody know 
how this is done in FLOW3?

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list