symfony - Delete parent entity on deleting child -


my problem parent entity not delete when i'm deleting child. have comment entity , 2 inheritance entities artcomment , postcomment. each 1 associated art or post entity. when i'm deleting post entity cascade deleting automaticly deletes postcomment in database comment not deleted.

comment:

/**  * comment  * @orm\entity  * @orm\inheritancetype("joined")  * @orm\discriminatorcolumn(name="discr", type="string")  * @orm\discriminatormap({"comment" = "comment", "art_comment" = "artcomment", "post_comment" = "postcomment"})  */ class comment  { } 

postcomment:

/**  * @orm\entity()  */ class postcomment extends comment {          /**      * @orm\manytoone(targetentity="post", inversedby="comments", cascade={"remove"})      * @orm\joincolumn(name="parent_id", referencedcolumnname="id", ondelete="cascade")      */     private $parent; } 

i trying deal creating trigger run after deleting artcomment , delete comment solution not working.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -