[Flow] Switch from DELETE to UPDATE column deleted
Carsten Bleicker
carsten at bleicker.de
Thu Apr 10 12:29:43 CEST 2014
If you want to detach the comments f.e. to keep them for stats f.e.
@ORM\JoinColumn(onDelete="SET NULL") could be a solution for the foreign site.
Am 10.04.2014 um 12:20 schrieb Carsten Bleicker <carsten at bleicker.de>:
> On the foreign site of a OneToMany you could use:
>
> * @ORM\ManyToOne
> * @ORM\JoinColumn(onDelete="CASCADE")
>
>
> Am 10.04.2014 um 12:14 schrieb Peter R <peter at webschuppen.com>:
>
>> Hello,
>>
>> is there an easy way to use a column like deleted in TYPO3?
>> How is it with a dataset which depends on other datasets e.g. delete a post and delete all comments.
>> A stupid way could be:
>>
>> $comments = $post->getComments();
>> $commentsCount = count($comments);
>> for ($i = 0; $i < $commentsCount; $i++) {
>> $comments[$i]->setDeleted(1);
>> $this->commentRepository->update($comments[$i]);
>> }
>> $post->setDeleted(1);
>> $this->postRepository->update($post);
>>
>> Peter
>> _______________________________________________
>> Flow mailing list
>> Flow at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
More information about the Flow
mailing list