[Flow] Remove problem

Mathis Hoffmann mathis at hoffpost.de
Tue May 14 15:02:24 CEST 2013


Hi David,

thank you for your reply!

OrphanRemoval has not been the solution. The problem is, that 
orphanRemoval only works for OneToMany and OneToOne associations to 
cascade the delete operation to privatly owned associated objects (in my 
case it's a ManyToOne assoc, which is not privatly owned).

The (in my opinion a bit hacky) solution I just found is to call 
$this->persistenceManager->persistAll() after removing the object from 
the repository.

@ the Flow team:
Maybe this would be something for the bug tracker (of cause I can post 
my code, if necessary for that) because for me that doesn't look like a 
feature ;).

Yours
Mathis

Am 14.05.2013 11:13, schrieb David Sporer:
> Hi Mathis,
>
> try to set orphanRemoval to true.
>
> @ORM\OneToMany(mappedBy="yourVar", orphanRemoval=true)
>
>
> Best regards
>
> David
>
>
>
> 2013/5/13 Mathis Hoffmann <mathis at hoffpost.de>
>
>> Hi,
>>
>> I have two entities that both have it's own repository. The first one,
>> called Payment, has a reference to the second one (ManyToOne). The second
>> one, called PaymentCategory, has to subclasses, called
>> IncomingPaymentCategory and OutgoingPaymentCategory and does not reference
>> "Payment". The root-class itself (PaymentCategory) is abstract. I
>> configured the inheritance type "joined" using the corresponding annotation
>> on "PaymentCategory". Creating and updating incoming and outgoing payments
>> works fine. But deleting them is rejected without any error - even if there
>> are no payments referencing to the category that I try to delete. I even
>> set the PaymentCategory-reference in "Payment" to "nullable=true" to avoid
>> any problems on the database-side and deleting the categories manually
>> works well.
>>
>> Does anyone know how to get deleting the entities work in Flow?
>>
>> Yours
>> Mathis Hoffmann
>> ______________________________**_________________
>> Flow mailing list
>> Flow at lists.typo3.org
>> http://lists.typo3.org/cgi-**bin/mailman/listinfo/flow<http://lists.typo3.org/cgi-bin/mailman/listinfo/flow>
>>
>
>



More information about the Flow mailing list