[TYPO3-mvc] detachAll()

Henjo Hoeksma me at henjohoeksma.nl
Wed Nov 23 21:31:30 CET 2011


Hi Tim,

thanks for your response. I get that, that would mean though you are
writing your own method in your domain model, correct?

I read in the Cheat Sheets of an already present detachAll() method.
Kinda like what happens here with detach():

public function removePost(Tx_BlogExample_Domain_Model_Post $postToRemove) {
 $this->posts->detach($postToRemove);
}

What if you would like to write it like this:

public function removeAllRelatedPosts([...]) {
$this->posts->detachAll([...]);
 }

What would be the proper way of writing it that way?

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Wed, Nov 23, 2011 at 21:23, Tim Schoch | GSTALTIG <tim.schoch at gstaltig.ch
> wrote:

> You can set the object storage to an empty one.
>
> Tim
>
>  _____
>
> From: Henjo Hoeksma [mailto:me at henjohoeksma.nl]
> To: TYPO3 v4 MVC project [mailto:typo3-project-typo3v4mvc at lists.typo3.org]
> Sent: Wed, 23 Nov 2011 21:20:16 +0100
> Subject: [TYPO3-mvc] detachAll()
>
> Hi list,
>
>  what would be the right way to detach all related objects from an object?
> I
>  find the possibility to use a detachAll() method, but can't find a way on
>  how to implement this in my model.
>
>  Thanks in advance for your replies.
>
>  Kind regards,
>
>  Henjo
>
>  Problems are small because we learned how to deal with them.
>  Problems are big because we need to learn how to deal with them.
>  _______________________________________________
>  TYPO3-project-typo3v4mvc mailing list
>  TYPO3-project-typo3v4mvc at lists.typo3.org
>  http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list