[TYPO3-mvc] how to add/remove related object in an m:n relation?

Roland most.wanted at gmx.at
Fri Apr 20 09:56:00 CEST 2012


omg, that was easy.

$item->addCategory($category);

and

$item->removeCategory($category);

as far as i remember, these methods are called something like "magic 
methods". thanks to my IDE which showed me that there exist these methods.

kind regards.

roland




Am 20.04.12 09:16, schrieb Roland:
> hi everybody,
>
> there is a class in my domain model "Item" which has a m:n relation to
> the class "Category".
>
> how can i add/remove categories for a specific item via extbase in the
> frontend?
>
> i added 2 new actions in the ItemController.php called "addCategory" and
> "removeCategory" but don't know which methods (of the repository?) make
> it possible to add/remove a specific categroy for this specific item.
>
> can anybody help? thanks.
>
> kind regards.
>
> roland



More information about the TYPO3-project-typo3v4mvc mailing list